I am trying to make a small form in MS Access 2003 SP3, I use some function that some other people made and these function has msgbox in it. I would like to disable msgbox while I am running the form. Is it possible in Access to disable msgbox?
A:
Press Alt+F11 to open the Visual Basic IDE, then press CTRL+F to search. Type
msgboxinto the find, select "Replace" and type
'msgboxinto the "replace with" box (note the apostrophe). This will comment out all msgbox statements in the project.
Lunatik
2009-03-21 20:06:07
A:
If in fact these message boxes are produced from VBA code, then comment them out. However, if they are Access generated, such as the message box when inserting or updating records, you need to use the command DoCmd.SetWarnings False in order to suppress them. Just make sure to turn warnings off only when needed, then turn them back on. Otherwise, ALL message boxes from Access will be off, even in "design mode".
HardCode
2009-03-22 02:25:19
Turning off warnings is terrible advice.
David-W-Fenton
2009-03-23 05:10:48
Sure, if you look at it from such a simplistic view. Have you ever worked with Access? You can turn off warnings for an Access application so the "Are you sure you want to update N rows?" popups don't show. Then you can turn them on again. It's NOT terrible advice.
HardCode
2009-03-23 17:19:09
+1
A:
I created my finction called msgbox. Seems like its working. Thanks everyone for your help.
Public Function MsgBox(Prompt, Optional Buttons As VbMsgBoxStyle = vbOKOnly, Optional Title, Optional HelpFile, Optional Context) As VbMsgBoxResult
If myProcedureisRunning then
VBA.MsgBox Prompt
else
debug.print prompt
endif
End Function
THEn
2009-03-25 17:53:53