Solved

Multiple Forms

Posted on 1998-07-08
2
138 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
Comment Utility
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
Comment Utility
Thanks for the Help :)
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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 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…
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…

762 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

12 Experts available now in Live!

Get 1:1 Help Now