Solved

Multiple Forms

Posted on 1998-07-08
2
139 Views
Last Modified: 2010-05-03
How do I pass a form into a function?
0
Comment
Question by:DanielJenkins
2 Comments
 
LVL 9

Accepted Solution

by:
cymbolic earned 100 total points
ID: 1465211
Forms are really just objects, and can be passed as parameters on your function call.  You can pass them as a form type, or as a type of Object, then your forms methods and properties are available to the function.  Your controls as well can be passed to functions in this manner.  All of these objects have windows handles, and are each uniquely identified by their hWnd (long integer handle).  That's all that really gets passed to the function.  At that point it has a Windows reference back into the object, via the passed handle.

Incidentally, to genralize your code even more, consider passing resultset/recordsets as well.  They work too.
0
 

Author Comment

by:DanielJenkins
ID: 1465212
Thanks for the Help :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now