Results 1 to 4 of 4
  1. #1
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    drill down and wild card criteria

    Hi



    have a simple form with a text field and a button.

    The user is asked to type in a Surname and then press the button.

    The onclick event of the buttom runs a macro that created a temprary variable of the value of the text field.

    The macro then opens a query with the criteria

    Code:
    [TempVars]![varSurname]
    this works perfectly and lists all records with say the exact name "Smith"

    I'd like to modify the search so that it would also list

    smith-jones

    and also if someone typed in

    smi

    it would show all surnames beginning smi ie smith, smithenson, etc etc

    Is this possible with what I've got by modifying the criteria or am I better to create a wild card search as in http://allenbrowne.com/ser-62.html

    thanks

    Ian

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Try a criteria of:

    Like [TempVars]![varSurname] & "*"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Jen0dorf is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    UK
    Posts
    453

    update

    Hi

    many many thanks I had tried

    Code:
    & "*"
    and of course failed - I missed the "Like"

    off to look it up

    cheers

    Ian

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    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. QUERY: Date/Time with a wild card as criteria?
    By excellenthelp in forum Access
    Replies: 3
    Last Post: 04-21-2015, 03:06 PM
  2. Drill Down capability
    By Eric@Gopher in forum Access
    Replies: 3
    Last Post: 08-07-2012, 01:01 PM
  3. Criteria from form to query with wild card
    By SteveW in forum Queries
    Replies: 3
    Last Post: 04-01-2011, 07:49 PM
  4. DoCmd.ApplyFilter with wild card
    By cksm4 in forum Programming
    Replies: 3
    Last Post: 10-05-2010, 08:24 AM
  5. Import with a wild card
    By ukgooner in forum Import/Export Data
    Replies: 3
    Last Post: 09-09-2009, 08:08 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