Results 1 to 4 of 4
  1. #1
    User25 is offline Novice
    Windows 11 Access 2016
    Join Date
    Nov 2023
    Posts
    3

    Form and subform relations tricky

    Just a guy who wants to learn...



    My goal is to update Attendace table easier by having a form where i could choose a team from a combobox and based on that value in a subform to have all the employees names associated with that team displayed one under another with DateAttendance, Hours, Minutes fields blank (from Attendance table) so i can input relevant data daily for all in the same time by pressing a Save button in that subform.
    The association between employees names and teams is done in the query called ActiveEmployees that takes its data from Employee table where i removed the ones who have an end date associated to their names, which means that they no longer work with us.
    Any help will be appreciated!!!

    I attached the draft! Thank you!
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Would need to create records for that team for that date. This is 'batch' creating records. An SQL INSERT SELECT can do that. Something like:

    CurrentDb.Execute "INSERT INTO Attendance(EmpID, DateAttendance) SELECT EmpID, Date() FROM Employees WHERE Active AND TeamID=" & Me.TeamID

    Then requery subform so these new records will display.

    Suggestion without viewing db as I cannot download now.
    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.

  3. #3
    moke123's Avatar
    moke123 is online now Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    I think I may have read your requirements wrong but here's an example anyway.

    Your tables need some normalization so I didn't use them. I also used list boxes instead of a combo.

    This may at least give you some ideas.
    Attached Files Attached Files
    If this helped, please click the star * at the bottom left and add to my reputation- Thanks

  4. #4
    User25 is offline Novice
    Windows 11 Access 2016
    Join Date
    Nov 2023
    Posts
    3

    Problem solved!

    Thank you. It really helped.

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

Similar Threads

  1. Tricky one... for me at least
    By lonlyspartakos in forum Forms
    Replies: 2
    Last Post: 05-17-2016, 04:49 PM
  2. Problems with Form (and/or) Relations
    By yaviens in forum Database Design
    Replies: 5
    Last Post: 05-01-2014, 10:26 AM
  3. subform a little tricky
    By buckwheat in forum Access
    Replies: 5
    Last Post: 09-11-2013, 01:05 PM
  4. Replies: 13
    Last Post: 09-17-2012, 08:46 PM
  5. Replies: 1
    Last Post: 04-01-2010, 05:40 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