2 Queries together?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to run 2 queries at the same time or one after another?
 
You don't give enough detail to answer your question precisely, so forgive me
if this has nothing to do with your problem.

From a form put on a button with the On_Click() code as something like:

Sub btn_On_Click()

Docmd.setwarnings false
docmd.openquery "Query1"
docmd.openquery "Query2"
docmd.setwarnings true

End Sub

This will run query1 and then query2

Hope it helps
 
Well, this is what I really, really want to do: I have one query than return
what items are under the minimum stock and in what area and the other return
what items are over the minimum stock and what area. Ideally, I would like to
have possibly 1 query that returns what under the minimum stock and also
returns where it is over the minimum stock so we can easier see what we can
move from where.
 
Try a Union query to get 2 queries into one. Something like:

Select YourTable.area, YourTable.quantity from YourTable where
YourTable.quantity<SomeMinValue
Union
Select YourTable.area, YourTable.quantity from YourTable where
YourTable.quantity>SomeMaxValue

Instead of going to design view for your query go to SQL view and type it in
there (you can't do a union query from design view)

(The syntax may not be perfect since it is off the top of my head, but this
should give you somewhere to go from.)

Good Luck
 
Well, this is what I really, really want to do: I have one query than return
what items are under the minimum stock and in what area and the other return
what items are over the minimum stock and what area. Ideally, I would like to
have possibly 1 query that returns what under the minimum stock and also
returns where it is over the minimum stock so we can easier see what we can
move from where.

I'd suggest using a Report with two Subreports, each based on its own
query.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top