Get rid of message boxes??

  • Thread starter Thread starter flen1
  • Start date Start date
F

flen1

Guest
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)!
 
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
 

Users who are viewing this thread

Back
Top Bottom