|
-
Jul 19th, 2000, 07:55 AM
#1
Hey all....
How can I stop code from executing when a from is show? Like in a commondialog and a msgbox?
Code:
Private Sub Form_Load()
frm2.Visible = True
'other code here...
How could I do it so that code stops executing after frm2 is shown, and continue after its hidden/unloaded?
Sunny
-
Jul 19th, 2000, 08:01 AM
#2
cheating?
Why not put it another way round:
Sub Form2_Unload()
'code here
form1.show 'load first form again
End sub
Alternatively, if you didn't wan't this occuring when the form2 closes, what about delaying the code with a timer control?
Hope this helps
Alex
-
Jul 19th, 2000, 08:03 AM
#3
Fanatic Member
Alternativley you could show the Form as modal. This will stop code execution in the calling form, until the new form has been unloaded.
Iain, thats with an i by the way!
-
Jul 19th, 2000, 08:12 AM
#4
Alex,
How would this stop the code from continuing to execute?
After frm2 is show, the code will continue to execute, and will frm2_unload will only execute when it is unloaded, which by then, countless errors would have occurred because it has already gone through most of the program without the needed variables which are obtained from frm2.
Sunny
-
Jul 19th, 2000, 08:19 AM
#5
ok good point, this works if it's a 1-2 code line, will give future answers more thought!
Alex
-
Jul 19th, 2000, 12:16 PM
#6
This code will show form2 and stop any code below the Loop.
Code:
Private Sub Form_Load()
frm2.Visible = True
Do
DoEvents
Loop
'other code here...
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|