|
-
Oct 10th, 2000, 11:42 PM
#1
Thread Starter
Frenzied Member
Hi,
I have a form which has code in it's load event to do some processing.. The problem is, the form does not become visible until the code has completed.. Is there a way of loading a form and allowing it to be visible first before the code executes?
The reason is that this particular code takes awhile. I have a label on the form which says "Please wait...", but like I said earlier, it's not becoming visible until after the code has executed so it serves not purpose..
any help would be appreciated..
Dan
-
Oct 11th, 2000, 12:46 AM
#2
Put the load code in teh Form_Activate event instead of the load, or put the code in a sub called "DoStuff", then call the form like this:
Code:
Load Form1
Form1.Show
DoEvents
Form1.DoStuff
- gaffa
-
Oct 11th, 2000, 12:17 PM
#3
Thread Starter
Frenzied Member
Thanks for the help but it did not fix my problem..
I tried both of your suggestions. I tried putting the code in the Activate event and also the code the you supplied. Both result in a problem.
The Activate event still seems to fire off the code before the form as time to show on the screen. The code you supplied shows the form but never executes the code and stays in an infinite loop, probably because of the DoEvents..
There has got to be a way to allow a form to show completely on the screen before executing the code..
Any other ideas?
-
Oct 11th, 2000, 02:48 PM
#4
Move your stuff into the Activate Event:
Code:
Option Explicit
Dim bFormLoaded As Boolean
Private Sub Form_Load()
bFormLoaded = True
End Sub
Private Sub Form_Activate()
If Not bFormLoaded Then Exit Sub
'this will show the form
Me.Refresh
'do your stuff here
End Sub
larryn
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
|