Multiple Criteria (1 Viewer)

basilyos

Registered User.
Local time
Today, 08:13
Joined
Jan 13, 2014
Messages
252
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)
 

Minty

AWF VIP
Local time
Today, 15:13
Joined
Jul 26, 2013
Messages
10,354
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
 

basilyos

Registered User.
Local time
Today, 08:13
Joined
Jan 13, 2014
Messages
252
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
 

basilyos

Registered User.
Local time
Today, 08:13
Joined
Jan 13, 2014
Messages
252
sorry it's my fault I wrote Full_Name instead of FullName

thank you so much
 

Users who are viewing this thread

Top Bottom