Results 1 to 5 of 5
  1. #1
    bigguy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    11

    Query search question

    I have the following code in my query [Forms]![ProjectSiteFrm]![NpiIDtxt]
    where NPIIDtxt is a textbox on a form. What I would like to have is when user enters
    data in text box it will find any records with those variables.

    The problem I'm having is users are not always entering the full string in the textbox so when they do a search it
    will give them a no records found. How would I change that so that any record which contains any of the values in the text box is returned

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Use LIKE operator and wildcard.

    LIKE "*" & [Forms]![ProjectSiteFrm]![NpiIDtxt] & "*"

    You say plural 'values' - what do you mean?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    bigguy is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    11
    Don't mean to say plurals. I tried the above code but no results are dispalyed and I know there are records in the database with at least some of the criteria

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    It is a proven technique. Post the complete SQL statement.

    If you want to provide your db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

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

Similar Threads

  1. Replies: 3
    Last Post: 10-31-2014, 08:08 AM
  2. Another Search Filter Question
    By r0v3rT3N in forum Programming
    Replies: 4
    Last Post: 07-23-2012, 12:20 PM
  3. Search Query within Dropdown Question
    By Scyclone in forum Programming
    Replies: 12
    Last Post: 10-11-2011, 10:53 AM
  4. Search Question
    By SPE_NY in forum Forms
    Replies: 3
    Last Post: 03-02-2011, 01:17 PM
  5. Some sort of search question...
    By ruski949 in forum Forms
    Replies: 2
    Last Post: 01-24-2011, 03:16 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