Results 1 to 3 of 3
  1. #1
    ScottySchultz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2018
    Posts
    8

    Macro using wildcard/LIKE

    I am using this 'Where Condition' to pull data into a report : [Owner_lbl] =[Forms]![Search Form].[txtName] and it provides accurate results as long as the name entered in the search form is typed exactly as it is in the table/query
    I would like to use a wild card or LIKE in order to allow for only a part of the name to be entered and still result in a successful search.
    The owner_lbl field contains names that are one of three of the following:

    singular owner ie: John Doe
    two owner ie: John and Jane Doe


    corporate ie: Acme Widget Co.

    Any help on how I can achieve this would be great. I'm not new to coding but it's been so long that I may as well be.

    Thanks for any assistance you can provide!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    I have a hidden 2nd box,txtNameWild, that looks at the box the user entered, txtName, but has the wildcards.
    property:="*" & txtName & "*"

    It puts the stars around the name, so the query can use it via:

    [Owner_lbl] like [Forms]![Search Form].[txtNameWild]



  3. #3
    ScottySchultz is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2018
    Posts
    8
    Once again, worked like a charm! Thank you very much, have a great weekend!

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

Similar Threads

  1. Wildcard Table
    By genedi in forum Access
    Replies: 4
    Last Post: 11-19-2015, 02:14 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. Filter with wildcard
    By gg80 in forum Programming
    Replies: 8
    Last Post: 10-07-2011, 06:29 PM

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