Multiple Criteria

basilyos

Registered User.
Local time
Yesterday, 18:01
Joined
Jan 13, 2014
Messages
256
hello guys

I want to search a table with 3 criterias

this is my code

Code:
If DCount("*", "tbl_violation_accepted_telegram", "[Accept_Description_Zone_Number] Like '*" & txt_Accept_Description_Zone_Number & "*' And "[Accept_Description_Zone_Name] Like '*" & txt_Accept_Description_Zone_Name & "*'" And "[Full_Name] Like '*" & txt_FullName & "*'") Then

txt_Accept_Description_Zone_Number Contains Number and sometimes Dash -
Accept_Description_Zone_Name contains alphabet
Full_Name contains alphabet

but access give me error (syntax error)
 
You aren't comparing the result to anything and have a couple of extra " in there. Try
Code:
If DCount("*", "tbl_violation_accepted_telegram", "[Accept_Description_Zone_Number] Like '*" & txt_Accept_Description_Zone_Number & "*' And [Accept_Description_Zone_Name] Like '*" & txt_Accept_Description_Zone_Name & "*' And [Full_Name] Like '*" & txt_FullName & "*'") > 0 Then
 
I changed the code to yours
am getting this error now
the expression you entered as a query parameter produced this error:
'[FullName]'

and big thanks for your help
 
sorry it's my fault I wrote Full_Name instead of FullName

thank you so much
 

Users who are viewing this thread

Back
Top Bottom