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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display progress bar/hourglass while running 3 minute script?

Status
Not open for further replies.

ajaeger

Technical User
Feb 6, 2003
201
US
When the user clicks a command button on my form, it calls a stored procedure that runs for about 3 minutes. While it's running, the cursor shows as a normal arrow, so it looks like the user can go ahead and click somewhere else and do something else. I don't want them to do this. Instead, I'd rather see an hourglass or progress bar (or message "WAIT" that changes to "FINISHED - OK" when the SP has completed) so that the know that the system is 'doing something' and they just have to sit and wait for a minute. Here's my code.

Any suggestions on how to accomplish this? Thanks.

Private Sub cmdRefreshTbl_Click()

Dim cnn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rst As New ADODB.Recordset

Set cnn = New ADODB.Connection
cnn.Open "ODBC;DATABASE=IMISDB;UID=sa;PWD=123;DSN=iMIS MS SQL"

Set cmd.ActiveConnection = cnn

cmd.CommandTimeout = 0

cmd.CommandText = "dbo.rpt_MO_Profile_Export"
cmd.CommandType = adCmdStoredProc

Set rst = cmd.Execute

cnn.Close

End Sub


Anna Jaeger
iMIS Database Support
 
the cursor shows as a normal arrow
you may try this:
DoCmd.Hourglass True
Set rst = cmd.Execute
DoCmd.Hourglass False

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top