flen1
12-17-2001, 03:10 AM
Can anyone please tell me if it's possible to get rid of the message boxes that warn you that you are aout to run a query/macro etc...?
Thank you
(If you know could you please tell me in simple terms because I'm only a novice on Access/VB. thanks)!
raindrop3
12-17-2001, 03:54 AM
Hello,
If you run the querie or macro by a command button, typ just before the code that fires the querie:
docmd.setwarnings false 'messageboxes OFF
Before the 'End sub' (the last sentence) type:
docmd.setwarnings true 'message boxes ON
The problem is solved!
Greetings,
Albert
Example:
Private Sub button5_Click()
DoCmd.SetWarnings False
On Error GoTo Err_button5_Click
Dim stDocName As String
stDocName = "qAlles"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_button5_Click:
Exit Sub
Err_button5_Click:
MsgBox Err.Description
Resume Exit_button5_Click
DoCmd.SetWarnings True
End Sub