Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic form queston.

Status
Not open for further replies.

f1car

Technical User
Apr 2, 2001
69
US
O.K. I’m totally missing something here?

I have a form1 that I need to call form2 and in form2’s code I want to run some more code. The problem seems to be that the project wants to handle form1 just like form2, as in both have,

Private Sub Form_Load()

So how can form1 call form2 if both the private subs have the same name?

I’ve been playing with the mdiform, but VB’s examples are pretty poor am I heading in the correct direction?

 
Depends on what you mean:

-if you want to reference variables on another form, say form 2, then do this: "Form2.Variable = so-and-so"

-if you want to load another form from from one, again form 2, then do this: "Show Form2".

Hope this helps :) Take Care,
Mike
 
This is a "Scope" thing.
Just as there is Scope with variables(Global, Modular & Procedure), Procedures have scope. All forms have a Form_Load, but notice that it is declared as Private. That means frm1 can't "see" frm2's Form_Load, and vice versa.
Hope that helps. Tim

Remember the KISS principle:
Keep It Simple, Stupid!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top