Results 1 to 6 of 6
  1. #1
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305

    How to lookup entries in table using ID

    Basically I have a table full over various incidents with an employee ID attached to each incident. Is there a way to have a separate section where you can type in the an employee ID and it will populate all the incidents (rows in the table) that have this corresponding employee ID? Right now I have to manipulate the table or do ctrl+f to find all the times an employee has been in an incident. Just looking for a cleaner way.



    I know I can export to excel and do a vlookup function to achieve the same thing, but I like to keep everything in Access (if possible)

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    what type of field is the ID field. Not an autonumber I hope. Sounds like you are working directly in tables, which you shouldn't. Don't know what a "section" is either, or what it applies to. An area on a form?
    You use query criteria to filter lists, which may or may not come from a form control. Point is, that's where it should be coming from - not from table filtering.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,642
    You can build a query with filter criteria. This is basic Access functionality.

    More than one way to acquire user input for criteria.

    1. intrinsic search/filter tools on ribbon and right click shortcut menu

    2. dynamic parameterized query (I never use these)

    3. code (macro or VBA) behind form, review http://allenbrowne.com/ser-62.html
    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.

  4. #4
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305
    Yea I am already doing this. I was just looking to try and develop a query where you can type in the employee ID and it will show the incidents only associated with this ID. And maybe press a "refresh" button and all that data goes away and you can look at another ID.

    I'm aware this is probably too specific of a request. I'm kinda new to Access so please don't yell at me haha

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,642
    If you want to work directly with query, use options 1 or 2.

    Option 2 will prompt for user input when the query opens.
    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.

  6. #6
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305
    Sweet. I appreciate the help!

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

Similar Threads

  1. Replies: 2
    Last Post: 08-29-2018, 04:42 AM
  2. Replies: 3
    Last Post: 06-02-2017, 03:49 PM
  3. New unwanted entries on lookup tables
    By OsborneBCKK in forum Forms
    Replies: 7
    Last Post: 07-25-2016, 01:37 PM
  4. Replies: 2
    Last Post: 05-07-2015, 02:55 PM
  5. Replies: 3
    Last Post: 09-27-2013, 11:50 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