Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[b]Multiple Field Query for Any Entry[/b] 1

Status
Not open for further replies.

rchamb1010

Technical User
Oct 10, 2006
7
US
I’m using Access 2003 and building queries, using fields as parameters, using the query design grid.

Several of the fields in my database relate to types of Services. I would like to be able to query on several of these fields at once – for example, Training, Maintenance, and Operations - to show me the records which are associated with one of those fields, for example, Training.

I don’t want to query by the actual entry in that field, in this case a company, but instead, find if there are any records in the database with entries in that field, and show me those results, which could be several companies.

I know to query one field, I can use Is Not Null. But I wanted to be able to query several Service fields at once, choosing the type of Service (field) each time I ran the query using a control on the query form.

I currently have all of the fields (connected with &) included in the Field portion of the query design grid, but I haven’t figured out what to say in the Criteria.

Many thanks!
 
You could conceivably construct a SQL statement based on selections from a form, assign this as the data source for a report or ListBox. I'm not sure if you can change the SQL of a query programmatically.

Another idea is to create separate queries for each field. Name them qry[SERVICECOLUMN] or something like that. Then you can select [SERVICECOLUMN] from a combobox and your button will open the query "qry" & forms!... ...![SERVICECOLUMN].

If you are just trying to do this through query designer, I think multiple queries are your only option.

Hope this helps,

Alex

Professor: But what about your superintelligence?
Gunther: When I had that there was too much pressure to use it. All I want out of life is to be a monkey of moderate intelligence who wears a suit. That's why I've decided to transfer to Business School.
Professor: NOOOOOOOOOOOO.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top