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

criterion for query entered from open form

Status
Not open for further replies.

tekboy

IS-IT--Management
Oct 15, 2002
9
US
I have a roport that is tied to a query. The query currently prompts the user for a shipping tally number. The query in turn uses that input as its critereon for its search. The report mentioned above is launced by a button on a form. That form also has the shipping tally number allready available in a field. Can I make the value from the "shipping tally field" in the form become the criterion for the querry automatically? So the user doesnt have to manually enter the value?
 
Yes
In the Query for the report type [forms]![Form Name]![field name}in the criteria row on that field
 
NOt working...any ideas on what to check? I double checked the code and entered it almost exactly as you said. xcept the last } wich I think you ment it to be a ]. Suggestions?
 
[Field Name] is the name of a text box on the form, right? It isn't the name of a field in a table. check that to make sure you have it right.

I find it's easier to get it right if I use the expression builder. Just right click in the criteria field, and choose "build". Then select the proper form and text box (or combo box).

 
go into the query and switch to the SQL view. the where clause has to look somehting like"

"...
WHERE [tally number] = '" & [Forms]![FormName]![FieldName] & "'".

assuming that the tally number is an alpha field. If this is your problem, you should get an error message indicating that a parameter is missing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top