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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the In(...) statement in queries

Status
Not open for further replies.

docliv

Technical User
Joined
Nov 11, 2002
Messages
21
Location
US
Hi,
I'm new at access and have hit a wall. I have a query where I use the.. In(a05,a02).. in a field to find all records that have "a05" and "a02" in that field. I want to be able to change the criteria that is in prints() on the fly using cut and paste or some kind of prompt. When I use a prompt and paste in the date (for example "a05"."a02"), it doesn't work, when I try to point to a field in another table that has this data, it doesn't work either. I tried writing a macro that would let me paste this data, but I can seem to move around in a query that is opened in design view rather than datasheet view...what kind of deal is this. This could all be avoided it I could just record keystokes, but I don't think I have that option. Any help anyone could give when be appreciated.. the application I am working on needs to be able to use this In(..) statement and fill in the print() based on changing data.
Thanks in advance for any response...kinda desperate and I have wasted a lot of time playing with this.
Thanks again.
Terry
 
Terry,
Create a query with all of the fields you need. In the criteria section of the field that has the a02 and a05 data place:
Like[enter 1st] or Like[enter 2nd]
When the query opens a "Enter Parameter Value" box will appear for each value you want to check. Use any prompt you want between the brackets. I don't know how many "like"'s you need (or can use...)
jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top