Access Expression Builder - Like & Not Like

Hi there,

I have the following scenario going in expression builder.

I want to sort a column for certain strings (say type 'A') but not for 'B'

The current formula I have is not working

Like (getstring([Forms]![Input]![txt1]) & "*") not like (getstring([Forms]![Input]![txt2]) & "*"

Open in new window


Any help is much appreciated!
LVL 13
Shanan212Asked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
try


Like (getstring([Forms]![Input]![txt1]) & "*") AND not like (getstring([Forms]![Input]![txt2]) & "*"
0
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
or this




[FieldName] Like (getstring([Forms]![Input]![txt1]) & "*") AND [FieldName] not like (getstring([Forms]![Input]![txt2]) & "*"
0
 
Shanan212Author Commented:
You just saved me a whole lot of time by switching to Expers Exchange!

Cheers!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.