Two queries

BobNTN

Registered User.
Local time
Today, 13:30
Joined
Jan 23, 2008
Messages
314
I know, it sounds silly,
Is there a simple way to run query "B" automatically after Query "A" runs ?
I looked at union queries but I can't see how to apply those to two totally different queries.

Thanks in advance
 
You can run the two queries from a command button on a form.

DoCmd.OpenQuery "Query A"

DoCmd.OpenQuery "Query B"

^
 
Geeeeez
I should have known that


Thanks EMP
 
This is the code for the button:

Code:
Private Sub DebitButton_Click()
On Error GoTo Err_DebitButton_Click

    Dim stDocName As String

    stDocName = "QryDbtM1"
    DoCmd.OpenQuery stDocName, acNormal, acEdit

Exit_DebitButton_Click:
    Exit Sub

Err_DebitButton_Click:
    MsgBox Err.Description
    Resume Exit_DebitButton_Click
    
End Sub
To run QryFuelM1 right after that one, do I need to add both the stDocName = "QryFuelM1"
and the DoCmd lines ?

Thanks again
 
Or simply

DoCmd.OpenQuery "QryFuelM1", acNormal, acEdit
 
As in EMP's post, just two lines of code will do:

DoCmd.OpenQuery "QryDbtM1"

DoCmd.OpenQuery "QryFuelM1"
 

Users who are viewing this thread

Back
Top Bottom