sam1 0 Posting Whiz

Hi,

I am trying to create a Please Wait message in excel vba. This is to let the user know while processin some sql querry at the background which may take unkown amount of time.

I would like to have it displaying in a userform.

The situation is:

Userform is displayed where user connects to sql db, selects db and some other options, press Go...at this point i have another form which pops up with message Please Wait...this form does not unload e.g. the sql execute command does not run.

My code for calling the please wait userform is (with a label in it):

Call WaitShow
SQl.Execute
Call KillWait

In the code module i have:

Sub WaitShow()
Wait.Show
End Sub
Sub KillWait()
Unload Wait
End Sub

I have userform called wait with following code:

Private Sub UserForm_Activate()
Call PleaseWait
End Sub

Sub PleaseWait()
Wait.Label1.Caption = "Calculating...Please Wait!"
End Sub

Now when executing the code, it doesnt move back to the module to execute

SQl.Execute

I can show the progress on the status bar but really want to use a userform pop up message.

Thanks in advance for your help.