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!

enter a field value in criteria of a query

Status
Not open for further replies.

lewie

Technical User
Joined
Jan 17, 2003
Messages
94
Location
US
How do i enter the value of a field into the criteria box of a query?
Lewie
 
Not sure what you are asking...
IF you are asking for an input box to open asking the user to enter some bit of info to limit the query on then try this:

Open your query, in the field that you want your user to enter limiting data into put something like this:

[Enter info]

in the criteria field. If I am not answering your question please post more info!

HTH,

jbehrne

If at first you don't succeed, call in an airstrike. - Murphy's Laws of Combat Operations
 
Hi Lewie.

Like this....

Forms!YourForm!YourField.value

Make sure YourField refers to the name of object on your form. So if it's Text1 on Form1 it would look like this:

Forms!Form1!Text1.value

To allow null values in the field enter this:

Like iif(Forms!YourForm!YourField.value is null,"*",Forms!YourForm!YourField.value)

Hope this helps.
 
Thanks for the quick response. What I need to know is I have 2 db's with values in similar fields. I wanted to make a query and print out all records when the value is equal. It looks like I can just set up a relationship between the two fields and when they are equal it will print them. I was trying to figure out what I would put in the criteria field that would represent a fields value in the table with no form involved. In other words how do i set the criteria field in a query to a field in a table.
Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top