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

Parameter query fails only when "prompting" for input!

Status
Not open for further replies.

bipeman

Technical User
Nov 20, 2001
9
US
This is wild! I have a field in my query based on the following expression: Expr1:(([Units]*[Current$PerUnit])-(([Weight]*[$/LB])+[Packgng]))/([Setup]+[Spec]+[Saving]+[Down]).
This expression gives the expected (correct) results. When criteria such as <100 are entered directly in the criteria line the results are also correct. The problem is that when I use a prompt for input, that is &quot;<[Amount]&quot; in the criteria line the results are incorrect. Results can vary wildly. Example: when entering &quot;1&quot; (parameter would be &quot;<1&quot;) the results are correct, but when entering &quot;2&quot; results are wrong with many returned values over 100. When entering 100 Results are incorrect with no vavlues less than 100 found although several exist. Got me beat! can anybody help?? Thanks!
 
You should be able to get around this by:

(1) While in query design view, click on Query then Parameters.
(2) Enter Amount (no brackets) for Parameters and Integer for Data Type.
(3) Rerun your query and it should provide correct results.
 
raskew,
Thanks very much for taking the time to reply. That did indeed solve my problem. Sure is nice to have help out there!
Best Luck,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top