Results 1 to 9 of 9
  1. #1
    Peter_M is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Apr 2021
    Posts
    2

    Search button on a form

    I have a button on a form to find a house - in a village of some 200 houses
    this works well except when searching for a house # with two digits eg. 36


    the search will also find House 136
    My question is

    how do I code this search to ensure that the Match is set to Whole Field in the Find and Replace?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    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
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Do not use the asterisk.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    @ranman, don't think they are using asterisk. They are opening the Find & Replace dialog and it is defaulting to "any part of field" for match.
    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
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    Agree with June, think the OP is talking about the Find and Replace form. This link should help

    https://docs.microsoft.com/en-us/off...ss.acfindmatch

    looks like the match parameter needs to be set to 1

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914

  7. #7
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    that is probably a better link!

    But does say the default is entire?

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Quote Originally Posted by Ajax View Post
    that is probably a better link!

    But does say the default is entire?
    We do not yet know what the OP is actually using?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  9. #9
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,412
    true

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

Similar Threads

  1. Replies: 1
    Last Post: 11-30-2016, 03:41 AM
  2. Search Box with Button on Form
    By guillermoftw in forum Access
    Replies: 2
    Last Post: 05-02-2016, 02:51 PM
  3. Replies: 5
    Last Post: 07-13-2012, 01:15 AM
  4. Replies: 12
    Last Post: 03-22-2012, 02:48 AM
  5. search button on Form
    By josejuancruz in forum Access
    Replies: 1
    Last Post: 12-23-2010, 07:21 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