Help with message boxes

whoisit

Registered User.
Local time
Today, 03:29
Joined
Oct 27, 2004
Messages
28
I have a macro which runs four update queries, which means that when it is run four update messages appear (you are about to update ... rows etc. etc.). How do i stop access from displaying these prompts and just update the records. Any suggestion such as VB would be appreciated.
If there are no solutions then no prob. I am only a beginner in VB
THANK YOU
 
Use

DoCmd.SetWarnings False
..your code for running queries...
DoCmd.SetWarnings True
 
Put this in a module:
Code:
Public Sub RunUpdateMacros()
    With DoCmd
        .SetWarnings False
        .OpenQuery "Query1"
        .OpenQuery "Query2"
        .OpenQuery "Query3"
        .OpenQuery "Query4"
        .SetWarnings True
    End With
End Sub

Whenever you want to use it,

Code:
Call RunUpdateMacros
 
Thanks a lot SJ McAbney the code works the module works
THANK YOU
thank you also to charityg, but as i am a beginner in VB i did not uderstand how to work your code
 
Sorry but i would like to know one more thing
With this module i would also like to open some forms and close some forms
any chance i could get this to work
THANK YOU
 
DoCmd.OpenForm "FormName"

and

DoCmd.Close acForm, "FormName"


It may be a good idea if you create what you know in a macro and then use the macro2vb converter to see what code it produces.
 
Thanks a lot
I have just found an option in the design view of the macro which lets you open a module. However when i run the macro it does open the module but in code view, it doesn't run it.
How do i make the macro run the module instead of displaying the code.
Does it have something to do with Procedure name
THANK YOU
sorry for all these questions but with all these change i am making to my database forms i am encountering new ones
thanks for all the help
 

Users who are viewing this thread

Back
Top Bottom