Results 1 to 3 of 3
  1. #1
    kazaccess is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    43

    Using wildcards in a query referencing a text box

    I have a form that opens up a query. The form has a text box where the user can type a name. If possible in the query editor, how would I go about this? For example, if the user types 'John', I would like the query to return the same as: Select * From Table Where Name Like %'John'%


    I have tried several variations of: WHERE Name LIKE %Forms![MyForm]!Name%, but with no luck. Any ideas?

  2. #2
    kazaccess is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    43
    Solved. If you are curious for your own purposes: WHERE [Name] LIKE "*" & Forms![MyForm]![Name] & "*"
    I didn't realize the "*" could be used in this case.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Thanks for posting your solution. FYI, as a general rule JET/ACE and DAO use *, ADO uses %.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 06-14-2013, 12:56 PM
  2. Referencing unbound text box on report
    By EffenNewGuy in forum Reports
    Replies: 8
    Last Post: 06-22-2011, 11:07 AM
  3. Referencing a query field
    By rcrobman in forum Queries
    Replies: 5
    Last Post: 04-29-2011, 04:06 PM
  4. referencing subform entry in selection query
    By Pielewuiter in forum Forms
    Replies: 22
    Last Post: 11-20-2010, 01:58 PM
  5. referencing combobox in query
    By Sparty in forum Forms
    Replies: 2
    Last Post: 09-27-2010, 11:32 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