Solved

Multiple Forms

Posted on 1998-07-08
2
141 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

820 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