'Not Like' doesn't work

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mhifd009
    New Member
    • Nov 2006
    • 28

    'Not Like' doesn't work

    I need to filter all Flint* type door styles but I can't seem to get the Not Like working as below :

    If (Me.slw < 740 And Me![Door Style] not Like "Flint*") Or Me.slw > 900 Then

    gives expected : expression

    any ideas please ?
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Originally posted by mhifd009
    I need to filter all Flint* type door styles but I can't seem to get the Not Like working as below :

    If (Me.slw < 740 And Me![Door Style] not Like "Flint*") Or Me.slw > 900 Then

    gives expected : expression

    any ideas please ?
    Try:

    IF left(Me![Door Style],5) <> "Flint" and (Me.slw < 740 or Me.slw > 900) then

    Nic;o)

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32633

      #3
      I'm not sure of your logic here Nico.
      I'm guessing the OP wants :
      Slw must be >900 unless DoorStyle starts 'Flint', in which case it can be <740.
      It's possible he actually means >740 there but his example shows it the other way around (<).

      From the jumbled format of the question I'm not even sure it hasn't worked as written (I would expect Like to work here).
      It might help to post what actually happened and what was expected with the data given.

      Comment

      Working...