
05-03-2004, 04:24 AM
|
|
Newcomer
|
|
Join Date: May 2004
Posts: 2
|
|
Code execution ordering
|
Hi all
Quick question about code execution (VB6), here's my scenario...
Form1 calls Form2 which displays a list of records, the user selects one and Form3 opens to show related records, the user once again selects one of these. Form3 sends the relevant record number to a global variable.
Both Form2 and Form3 now close and the user is back to where they began, and in a field on the form, should appear the contents of the global variable set by Form3.
The problem I am having is, after calling Form2, the piece of code which reads the global variable into the field on Form1 executes as soon as Form2 opens, which is, of course way too soon (it should execute after Form3 is closed).
How do I get VB to execute the loading of the two forms, and then move on to the statement following the Load Form1 line once forms 2/3 have closed?
I realise I could put something on Form3 to put the appropriate value directly onto Form1 by going
Code:
Form1.textbox1 = blaablaablaa
, but I want to use this form2/form3 combo in other places in the program too, where the final value will be output to forms other than Form1.
I hope this makes sense to someone, thanks in advance for any help. 
|
|