Pop up Flag

P

Pam C

If I have users that are running queries, and it takes a while because of the
records in the database, and the hour glass stays for a while, the users are
stopping the query because they think their PC is hung up. Is there a way I
can have a flag appear to say do not leave, records are updating, wait.
 
B

Barry-Jon

How are they stopping the query? CTRL+Break ? How is the query being
executed?

If they are simply quitting the application you could have a hidden
form that checks the value of a global variable that you control in the
background - (e.g. blnQuitAllowed). The check would occur in the
Unload event of the form, if it was ok to quit it would - if not it
would warn the user (though it wouldn't have to). Sample code below.
If they are pressing CTRL+Break I don't know what I would do...

Private Sub Form_Unload(Cancel As Integer)

If blnQuitAllowed Then
Cancel = False
Else
'Warn them, if you like
If MsgBox("Application busy - quitting may cause data errors."
& vbCrLf & vbCrLf & _
"Are you sure?", vbQuestion + vbYesNo) = vbYes Then
Cancel = False
Else
Cancel = True
End If
End If

End Sub
 
Top