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
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