Simple question on doing queries

WAYNEB

New member
Local time
Today, 08:40
Joined
Jul 7, 2003
Messages
9
I need to do multiple queries in an access report. I'd like to do a query where I can select 1, 2, all or none of the vendors, then do a query by individual week, and then do one by open orders. Do I do them all in the same query sheet that was previously set up (the person who did the initial query sheet no longer works with me) Any help would be greatly appreciated. I am thinking i need to check certain boxes in the show and then input information in the criteria fields. Thanks.
 
You could do it all in one query and set conditions on who to select. For example have a form with 2 textboxes and a check box.

If they want 1 or 2 vendors get them to type in their ID or name and run a query in your code which just selects the records where the ID's match and the checkbox will just run the master query to get all the vendors.

You can do the same by date and open orders aswell.
 
tHANKS!

Now I just need to figure out how to insert the textboxes!
 
Sorry for the confusion

In the show field of the table, there are boxes that can either go checked or unchecked. I was wondering how to create the boxes in the show field.
If I wanted to generate several different reports, do I need to do the conditions on separate line items or create a brand new query for each? Thanks.
 
You can make a master query that gets all the information for all the reports that you need.

And in your code you do seperate queries that only get the data you need.

Here is an example of what I mean from a program I am developing. I don't get info from a query but you can.

Code:
   Dim db As Database
   Dim sqlPart As String
   Dim rsPart As Recordset

   Set db = CurrentDb()
   sqlPart = "SELECT * FROM tblparts WHERE Area='" & UArea & "' AND [Page]='" & UPage & "'"
   Set rsPart = db.OpenRecordset(sqlPart, dbReadOnly)

By setting conditions of the sql statement you can get only the data you need.


So if you wanted all the records that are still open you select everything from the master query where the open value is true. All this does is creates a recordset that will close when told. This saves from haveing a large db with a bunch of queries.

You know if you feel more comfortable making seperate queries for each report just do that. Save you from getting all confused.
 

Users who are viewing this thread

Back
Top Bottom