Supress Msg Boxes

bunji

Registered User.
Local time
Today, 08:47
Joined
Apr 26, 2005
Messages
124
When running two append queries from a button how can i suppress the confirmations msgs to make just one custom msg "Are you sure Yes/No" Then "Import Complete".

Private Sub Import_Click()

Docmd.OpenQuery "Append1"
DoCmd.OpenQuery "Append2"

End Sub
 
You can not do what you want since you are running two seperate action queries. What if they clicked no to one or the other? Do not trust the user to make the right decision when it comes to modifying the data.

I suggest that you ask the user upfront if they want to run the "append function" and let them decide if they want to do it all or not.

Code:
    If MsgBox("Do you want to run the appending function?", vbQuestion + vbYesNo, "Append Data") = vbYes Then
        DoCmd.SetWarnings False
        DoCmd.OpenQuery "Append1"
        DoCmd.OpenQuery "Append2"
        DoCmd.SetWarnings True
    Else 'user clicked no
        MsgBox "Appending aborted", vbInformation
    End If
 

Users who are viewing this thread

Back
Top Bottom