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

"Not a valid name" return on parameter query 2

Status
Not open for further replies.

cizmad

Technical User
Jul 6, 2005
14
0
0
US
I'm trying to create a fairly basic parameter query that will prompt users to input search criteria to looks for specific products in our database, but something off is happening. Once I have everything in place (including the bracketed "What do you want to search for?") and try to run the query, it returns "(query name) is not a valid name" and advises me to check for invalid punctuation or characters. It is doing this regardless of what the query name is or is changed to.

Anyone have any idea what is going on?
 
Hi
It might be best to post the SQL of the query.
 
Here goes...

SELECT Products.ProductID, Products.[Catalog Number], Products.[Product Details], Products.UnitPrice, Products.SupplierID, Suppliers.SupplierName
FROM Suppliers INNER JOIN Products ON Suppliers.SupplierID = Products.SupplierID
WHERE (((Products.[Product Details])=[Search products for...]));
 
Are any of these fields "Lookup Fields"?
Are you expecting users to enter the exact parameter or would you like them to be able to enter a partial match?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Ideally they'd be able to enter a partial match since we're working primarily with biological and chemical compounds (and no one in their right mind wants to enter Boc-Z-Ala-etc-etc-etc), but right now I'm more concerned with getting the query to work at all.

Any help on the latter would be great, any help on the former completely awesome.

Thanks.

-Ciz
 
Hi
I tried the above query as shown, and Access objected to the three dots.
 
Removed the dots from the criteria... the return, alas, is still the same. Fancy that.
 
Aha! It worked on second try, for some reason. Thanks awfully.

-Ciz
 
It is, as suspected, rather trying to enter the entire product details to find the match - is it terribly complicated to shift it so that a partial match will produce results? I think I've tried most of the possible combinations of brackets and asterixes known to man to try and allow user-inputted, wildcarded searches to no avail, but I probably am just missing something fairly basic (I hope).
 
WHERE Products.[Product Details] Like '*' & [Search products for] & '*';

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Once again, exactly what I needed. ; )

Thanks very much, all of you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top