Results 1 to 5 of 5
  1. #1
    andyt_2005 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    12

    Wildcard seacrh

    Hi all,
    So my serch function works fine however i would like to add a wildcard (*) Its to do with reference numbers which begin with letters followed by a dash then numbers (AB-123) (qw-321)
    So i would like to search without the letters but including the dash

    rs.FindFirst "[FaultNumber]=""" & Text19 & """"

    This is what im using, where would i put the wildcard? i have tried a few different combos but no joy yet.
    A little help please?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I believe the following should work for requiring the user to enter the beginning of the text.
    rs.FindFirst "[FaultNumber] LIKE '" & Text19 & "*'"

  3. #3
    andyt_2005 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    12
    Sorry i wanted the user to only enter the dash and the numbers,
    rs.FindFirst "[FaultNumber] LIKE "*'" & Text19 & '"

    Would this be right?
    So i can just enter " -1234 "

  4. #4
    andyt_2005 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    12
    Quote Originally Posted by andyt_2005 View Post
    Sorry i wanted the user to only enter the dash and the numbers,
    rs.FindFirst "[FaultNumber] LIKE "*'" & Text19 & '"

    Would this be right?
    So i can just enter " -1234 "

    got it Thanks for your help!
    rs.FindFirst "[FaultNumber] LIKE '*" & Text19 & "'"

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Yup, I think you got it. You can have a wildcard on both sides too.
    rs.FindFirst "[FaultNumber] LIKE '*" & Text19 & "*'"

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Using a wildcard if an IIF statement.
    By atlee in forum Programming
    Replies: 6
    Last Post: 02-23-2014, 04:02 PM
  2. Replies: 9
    Last Post: 12-05-2013, 11:48 AM
  3. Wildcard within a combobox
    By T_Tronix in forum Access
    Replies: 10
    Last Post: 11-21-2013, 03:35 PM
  4. Querying a wildcard
    By undee69 in forum Queries
    Replies: 1
    Last Post: 10-15-2012, 06:00 AM
  5. If OR statement (maybe a wildcard?)
    By Lorlai in forum Queries
    Replies: 5
    Last Post: 07-27-2011, 10:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums