Re: LinkCriteria with AND

Tech-Archive recommends: Fix windows errors by optimizing your registry



"NetworkTrade" <NetworkTrade@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:7E319165-F171-451C-B0E9-598DC19F7BB2@xxxxxxxxxxxxxxxx
having a syntax brain freeze....

this works fine:

stLinkCriteria = "[ID]Not Like 'I*'"

All IDs show on the opening report - except those that start with an I

and now I need to make both Not Like I and Not Like G

so that all IDs show on opening report except those that start with I or G

I think I'm wrestling with the " symbol.....


You could do this:

stLinkCriteria = "[ID] Not Like 'I*' AND [ID] Not Like 'G*'"

Or, taking advantage of a different variation of the pattern-matching afforded by the Like operator, you could do this:

stLinkCriteria = "[ID] Like '[!IG]*'"


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

.