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

    Subform help!

    Hello there,

    I really need some help please from some of you extremely talented people!

    I am designing a new access based database for my team and i've come across an issue that i've spent hours and hours on that i just can't seem to get right even after following guide after guide.





    I have attached an extremely watered down version of the database as the full version includes a lot of personal information for you to have a look at if possible.


    Basically, my team looks after around 30,000 users, managing access to systems via a smartcard and we need to keep track of the access each user has. Users move around and receive access to a different organisation every day. This is what I need to capture.
    In this version i have created just one test user, each user has a UUID and for this test user the UUID is 883918982017, if you search for this user on the reg users form their details will be displayed along with the access they currently have.


    I need to be able to add a new position to this user via a combo box that you would enter the organisations code which then would show the correct positions for that organisation in another combo box and when i click on the correct position it updates the link table in the background in turn adding it to the list of positions assigned to the user. ( I really hope i'm making some sort of sense!)


    I created the form frmAssignPos to be used as a subform which works if you open that form on it's own but if used as a subform it always asks for a parameter value before displaying the list of positions?


    Any help would be greatly appreciated, i'm just stuck and it's hurting my head!


    Kind regards


    Lee
    Attached Files Attached Files

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Just change the row source for the second combo to include the parent form:
    Click image for larger version. 

Name:	Capture.PNG 
Views:	32 
Size:	54.7 KB 
ID:	45028
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    leehi82 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Apr 2021
    Posts
    10
    Thank you! I can't believe it was that simple.

    My next problem is getting the button 'assign position' on the subform to refresh the main form so it updates the assigned positions subform?

    Thank you again, it's very much appreciated!

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    Maybe try this:
    Code:
    Me.Parent.Form.Requery
    Cheers,
    Vlad
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    See if this helps. It duplicates some of Vlad's fix.
    Also established ref integrity for tables.
    Set Data Entry = NO for the Users form.
    Changed linkage between Users and Smartcards tables to 1 to many. I assume users could have more than one smartcard.
    Click image for larger version. 

Name:	link.png 
Views:	29 
Size:	20.1 KB 
ID:	45031 Click image for larger version. 

Name:	orig.png 
Views:	29 
Size:	11.6 KB 
ID:	45032

    Test database-davegri-v01.zip

  6. #6
    leehi82 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Apr 2021
    Posts
    10
    Thank you both very much for your help!

  7. #7
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,389
    Good luck with the project and thanks for the star!

  8. #8
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    You're very welcome!
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  9. #9
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You really should avoid using spaces in object names.

    You might also look at Microsoft Access Tables: Primary Key Tips and Techniques

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

Similar Threads

  1. Replies: 6
    Last Post: 07-08-2020, 12:26 PM
  2. Replies: 2
    Last Post: 01-21-2018, 09:19 PM
  3. Replies: 3
    Last Post: 06-29-2017, 03:02 PM
  4. Replies: 1
    Last Post: 12-05-2016, 02:23 PM
  5. Replies: 6
    Last Post: 05-05-2012, 08:43 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