Results 1 to 2 of 2
  1. #1
    MrMango is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    1

    Help with a query to look for a specific key value in any of three different fields of another table

    I have a Contacts table with a key called ContactID. I also have a document table to store attachments with searchable attributes. When a document is entered into the table via a Document form, the user has three fields where he/she can select a Contact that is associated with that document. For example: a document named "Joe Smith Incident Report 1Aug2018.pdf" is primarily regarding a client named Mr. Smith but may also involve two other clients like Juanita and Bobby. The user enters Mr. Smith into the first field that stores a ContactID and then also adds Juanita and Bobby into the other two fields storing ContactIDs.

    How do I setup relationships or a query to check the [Documents]![IDContact1] for a match and then check [Documents]![IDContact2] and [IDContact3] to find matching records? I want to find ALL documents pertaining to a specific person [Contacts]![ContactID] that are stored in the Documents table in ANY of these three fields: IDContact1, IDContact2, IDContact3. I tried joining all three of those fields with a relationship to [Contacts]![ContactID] but the query that I created next thought that I wanted only records where the specific key showed in all three fields SIMULTANEOUSLY.



    MS Access 2016
    Win 10
    Attached Thumbnails Attached Thumbnails Relationships for documents relating to contacts..png  

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Did you try OR operator in query?
    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.

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

Similar Threads

  1. Replies: 6
    Last Post: 07-03-2018, 03:51 PM
  2. Replies: 1
    Last Post: 02-26-2017, 09:28 AM
  3. Replies: 1
    Last Post: 02-23-2016, 08:36 PM
  4. Replies: 1
    Last Post: 02-19-2014, 05:49 PM
  5. Replies: 1
    Last Post: 07-06-2012, 05:32 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