Or What?

chuckster

Registered User.
Local time
Today, 04:13
Joined
Oct 4, 2000
Messages
52
I would like to be able to type in multiple field numbers as criteria in a query.

How would one go about doing this? I have the fields criteria linked to a form but can only print one record at a time.

Thanks.
 
You need to make sure that your criteria are "OR"d.

Let's say that you have 3 text boxes on your form (txtField1, txtField2, txtField). You'll need three criteria rows in your query, in the column for Field. The first will look like:
[Forms]![fMyFormName]![txtField1]
and the second will be:
[Forms]![fMyFormName]![txtField2]
followed by:
[Forms]![fMyFormName]![txtField3]
Access will "OR" these three fields together. Note that you will need to repeat any criteria for other fields on each row.

If this gets to be too much (more fields than you want to repeat), you might find that you could create a filter or build a WHERE clause more simply.
 
Thanks M8. I was hoping for a solution that was more scalable that looped and kept asking for the next number until a null entry was sent and used all the valid numbers as criteria. I would like to select between 5 to 200 numbers which have no real relationship to one another.(Which rules out filters and where clauses.) I think.

I ended up creating a form linked to a table that deletes itself on exit.

The user then uses the form to fill in all the numbers and when done clicks to print report button which jumps back to the first field and prints a report with the forms field as criteria then docmd.gotorecord,,acnext and then prints the report for the next record and so on.

Sounds a bit messy and takes longer than I would like but works ok and can be resued for other reports.

Thanks again
chuck.
 

Users who are viewing this thread

Back
Top Bottom