Results 1 to 4 of 4
  1. #1
    scott0_1 is offline Advanced Beginner
    Windows Vista Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    82

    List forms a user does not have access to - comparing two tables

    SQL not my friend today!



    I have two tables:
    • tblUserFormAccess which has ID, FormID and UserID
    • tblFormDescription which has ID (fk is FormID), FormName and FormDescription


    I use tblUserFormAccess to control what forms users have access to. For example, 1 | 10 | skennedy

    I'm trying to create a list of forms in tblFormDescription that a user does not have access to. I've been staring at joins and exists and ins for the last hour in different examples, but I can't figure it out.

    Any ideas?

    p.s., I really appreciate all the help everyone on this forum offers. I get a lot of help for what probably seems like very mundane problems!

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    did you try the Unmatched query wizard? It should create the correct join for you based on your input.
    EDIT
    Although I think you have the fk field in the wrong table. The forms table is a one side. The permissions table is likely a junction (many side) between tblUsers (another one side) and the forms table. The form ID should be the fk in the permissions table.
    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
    52,902
    Need a dataset of all possible user/form pairs. This can be generated with a Cartesian query. Every record in each table will associate with every record of other table. Do you have a tblUsers?

    SELECT tblUsers.ID, tblFormDescription.ID FROM tblUsers, tblFormDescription;

    Then build a FindUnmatched query with the Cartesian dataset and tblUserFormAccess using compound join.
    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
    scott0_1 is offline Advanced Beginner
    Windows Vista Access 2013 32bit
    Join Date
    Apr 2018
    Posts
    82
    Quote Originally Posted by June7 View Post
    Need a dataset of all possible user/form pairs. This can be generated with a Cartesian query. Every record in each table will associate with every record of other table. Do you have a tblUsers?

    SELECT tblUsers.ID, tblFormDescription.ID FROM tblUsers, tblFormDescription;

    Then build a FindUnmatched query with the Cartesian dataset and tblUserFormAccess using compound join.
    I didn't feel so bad once I saw the terms "Cartesian query" and "compound join"! Worked perfectly!

    Quote Originally Posted by Micron
    Although I think you have the fk field in the wrong table. The forms table is a one side. The permissions table is likely a junction (many side) between tblUsers (another one side) and the forms table. The form ID should be the fk in the permissions table.
    You're completely right. I wrote that after 10 hours of sitting in front of the computer and a couple of which were dealing with this! It was a mixture of tiredness/frustration/laziness! (mostly the latter).

    Thanks for the help!

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

Similar Threads

  1. Replies: 2
    Last Post: 12-12-2016, 04:33 AM
  2. Replies: 2
    Last Post: 11-25-2015, 08:03 PM
  3. Replies: 6
    Last Post: 10-16-2014, 12:55 PM
  4. Replies: 1
    Last Post: 04-02-2014, 06:46 AM
  5. User Level Permission/Access to certain forms
    By kmims44 in forum Programming
    Replies: 1
    Last Post: 07-24-2012, 06:13 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