Running 2 queries and an open form from a single mouse click

k5kowboy

Registered User.
Local time
Today, 00:43
Joined
May 28, 2003
Messages
13
I have an issue that I can't seem to figure out. I have a form with a check box (indicating "yes") that I need to perform the following functions when it is checked.

1. Move selected data from "table 1" to "table 2" (I have accomplished this with an Append Query)
2. Delete that record from "table 1". (I have accomplished this with a Delete Query)
3. Open a new form to that specific record from "table 2"

I would like all of this accomplished with a single click of the mouse when the check box is checked. Any ideas?:confused:
 
I would set up and event procedure for the On Click event and put the following code in it:

DoCmd.OpenQuery "Query1Name"
DoCmd.OpenQuery "Query2Name"
DoCmd.OpenForm "FormforTable2"

Something on that lines should work or at least get you on track.

HTH
 
Here is what I put in place and it doesn't seem to work correctly.

Private Sub Repo_d_Click()

DoCmd.OpenQuery "UpdateInventoryFromGenInfo"
DoCmd.OpenQuery "DeleteFromMainAfterInventoryUpdate"
DoCmd.OpenForm "Inventory"

End Sub

If I put spaces between the words in quotations for the Open Query command, it doesn't do anything except open the form (the queries don't run). However if I remove the spaces (like they are above), it gives me an error that it can't find the object to run.
 
Hmmm

The DoCmd.OpenQuery line does not appear to work for "special" queries (Delete, Append, etc). However, if I put the name of a "normal" query in it's place, it works just fine. Is there a special command line for "special" queries?
 

Users who are viewing this thread

Back
Top Bottom