Results 1 to 3 of 3
  1. #1
    sheckay is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    May 2022
    Posts
    73

    Search by one criteria open record based on another criteria from results of search

    Hello. So I have a search button that searches by one field. The results show up in a list box. There may be multiple results in the search if there's a -a or -b added to the general starting number, creating different orders from the original. So if there are 3 orders xyz, xyz-a, xyz-b and the user puts in xyz into the search all 3 show up. The command button just opens a form based on the search criteria. So when that form opens you can navigate from 1 to 2 to 3 (of 3).
    Is there a way to highlight one of the three orders in the search box and have a different command that opens the order form but based on a field of the order that's highlighted, which would be a different field than what was used as the initial search criteria?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    this assumes you have a textbox on the results form called ID that is a unique key for that record
    and it is numeric

    then open only that record: docmd.openform "fMyForm",,,"[id]=" & me.ID

  3. #3
    sheckay is offline Advanced Beginner
    Windows 10 Office 365
    Join Date
    May 2022
    Posts
    73
    OK, so the me.ID part is the part that gets ID from the selected record?

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

Similar Threads

  1. Replies: 8
    Last Post: 08-29-2018, 04:19 PM
  2. Replies: 3
    Last Post: 11-27-2016, 06:34 AM
  3. Replies: 3
    Last Post: 09-12-2016, 11:49 AM
  4. Replies: 1
    Last Post: 03-26-2015, 11:08 AM
  5. Open form based on search criteria
    By cactuspete13 in forum Forms
    Replies: 7
    Last Post: 03-06-2013, 10:17 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