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

Trouble filtering results in a query 1

Status
Not open for further replies.

jeevenze

Technical User
Mar 13, 2001
62
US
I'm having trouble filtering results in a fairly simple query, I'm trying to filter the records by username. I have the query...

SELECT [tblorderinfo].[orderID], [tblorderinfo].[username], [tblorderinfo].[recepient_name], [tblorderinfo].[shipaddress1], [tblorderinfo].[shipaddress2], [tblorderinfo].[shipcity], [tblorderinfo].[shipstate], [tblorderinfo].[shipzip]
FROM tblorderinfo
WHERE ((([tblorderinfo].[username])=[strusername]));


when I enter a test user name that exists and run the query I do not get any results. However I can filter the results according to all the other fields! The username field is a text field with Indexed=NO and is the only field where I can't filter the results by.

Does anyone have any ideas why this might be happening.

Thank you in advance to anyone who can help me.

Jeevenze
 
Hi Jeevenze
I assume that the query is being called by a form and on the form you have a text box called [strusername].

If so then the last line of you SQL should read:-
WHERE [tblorderinfo].[username])=forms![YourFormName]![strusername]

Hope this helps. If not please give me more information about how and where you are calling the query from.

Miguel
 
Ziggurat,
I'm calling the query from dreamweaver ultradev. But I tested it in access by running the query, and a pop up box appears asking to enter a value for the parameter, and I enter username's that already exist in the records but I don't get the results.
 
Hi Jeevenze
One thing that I can suggest is:-
STEP 1: open the query in design mode and take out the selection parameter.
Then run the query to see what results you get.
Do you get a list of results?
If No then there is something wrong with your SQL.

If Yes
STEP 2: Next enter a text string for one of the user names in the place where you had the selection parameter and run the query again.

Do you get a selected list of results?
If Yes then replace the selection parameter and run the query again using the same username that you used in STEP 2.


*
***
*****
*******
Ziggurat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top