Using wildcards in query input

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john

    Using wildcards in query input

    In a query I have put the following criteria in a field:
    [enter last name]
    Now I would like the query to use this user input to search with wildcards.
    So, if he enters john, in fact the query should search like:
    *john*
    Is that possible?
    Thanks,
    john


  • Allen Browne

    #2
    Re: Using wildcards in query input

    Use the Like operator and the * wildcard in the criteria:

    Like "*" & [enter last name] & "*"

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "john" <john@test.comw rote in message
    news:0IGdncmTMa Bkr1vZRVnyrA@ca sema.nl...
    In a query I have put the following criteria in a field:
    [enter last name]
    Now I would like the query to use this user input to search with
    wildcards. So, if he enters john, in fact the query should search like:
    *john*
    Is that possible?
    Thanks,
    john

    Comment

    • john

      #3
      Re: Using wildcards in query input

      Thanks.
      john

      "Allen Browne" <AllenBrowne@Se eSig.Invalidsch reef in bericht
      news:44c63691$0 $23489$5a62ac22 @per-qv1-newsreader-01.iinet.net.au ...
      Use the Like operator and the * wildcard in the criteria:
      >
      Like "*" & [enter last name] & "*"
      >
      --
      Allen Browne - Microsoft MVP. Perth, Western Australia.
      Tips for Access users - http://allenbrowne.com/tips.html
      Reply to group, rather than allenbrowne at mvps dot org.
      >
      "john" <john@test.comw rote in message
      news:0IGdncmTMa Bkr1vZRVnyrA@ca sema.nl...
      >In a query I have put the following criteria in a field:
      >[enter last name]
      >Now I would like the query to use this user input to search with
      >wildcards. So, if he enters john, in fact the query should search like:
      >*john*
      >Is that possible?
      >Thanks,
      >john
      >
      >

      Comment

      Working...