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

problem with wildcards /searching

Status
Not open for further replies.

RevelationUK

Technical User
Jun 29, 2005
6
GB
The following query:
SELECT tblCustomers.*
FROM tblCustomers
WHERE Forms!frmFindCustomer!txtSurname Like tblCustomers!Surname And Forms!frmFindCustomer!txtAddrLn1 Like tblCustomers!AddrLn1 And Forms!frmFindCustomer!txtPostCode Like tblCustomers!PostCode And Forms!frmFindCustomer!cboStates Like tblCustomers!State;
returns no records when I put in "*" or "%" in all 4 fields in my form. I also tried running the query independently and when it asks me for values of Forms!frmFindCustomer!txtSurname i put in "*" or "%". Why is it not returning anything?
 
that query looks more like a MS Access query then a MS SQL query with the ! and forms references; maybe check the access help or see whats actually being sent to your server, maybe the forms arent' filling in your values right before the query is sent to SQL server and you're not getting your results returned. I'm not an access person.

MAL
 
sorry, I found the problem. The query should be:
WHERE tblCustomers!Surname LIKE Forms!frmFindCustomer!txtSurnameNOT
WHERE Forms!frmFindCustomer!txtSurname Like tblCustomers!Surname

odd :(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top