Results 1 to 8 of 8
  1. #1
    alhas is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2011
    Posts
    7

    Newbie question re main form and subform

    Sorry, as a complete newbie, I'm unsure how to get the following to work. Any help gratefully received.



    I have an Employees table (just with fields EmployeeID, FirstName, Surname and JobTitle for now), and want to record attendance/absence (In office; Off work; Working from home; etc) for each employee for every date. (I have a 'Days' table, with Date, WeekNumber etc fields).

    How may I set up a main form ('Single form') with employee name etc and a subform ('Continuous form') recording attendance/absence for the employee on each and every day in the Days table ?

    thank you very much

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I think you should first of all make sure that you create a Relationship between your Employees table and the Days table - linking EmployeeID in both tables.
    The link will be One to Many with the 'One' being on the Employees table [because on Employee will have Many Attendance records].

    Next, you should create your Sub Form as a Continuous Form and make sure it is declared as a Child Form to your Employees Form.

    Once you have done this, each time you switch Employees on the Main Form, you should see the Attendance information for the employee currently showing on the Main Form - on the Sub Form.

  3. #3
    alhas is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2011
    Posts
    7
    Thanks, Robeen. I'll give it a try as soon as I can. One thing I'm unsure of in your message: "...make sure it is declared as a Child Form to your Employees Form." How's that done, please? (Again, excuse my present Access ignorance).

  4. #4
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Try reading this:
    http://office.microsoft.com/en-us/ac...010098674.aspx

    It's a pretty good place to start.

    Let us know if you need more help.

  5. #5
    alhas is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2011
    Posts
    7
    Hi again. Well, I tried (using EmployeeID as Master and Child), but - unless I'm forgetting to do something - I can't get the form and subform I want. I want to do the following:

    Main form:
    Employee's name and ID

    Subform:
    Form header: Date Week number Attendance/Absence

    I want the subform to list ALL (past, present and future) dates in the 'Days' table.
    The idea being that I should be able to open up the main form, navigate to a particular employee, navigate (vertical scroll bar) to any particular day(s) in the subform, and record in the 'Attendance/Absence' field in the subform where that employee will be (In the office; Working from home; On holiday; etc)

    How do I force the subform to show me all dates in table 'Days', please?
    Thank you

  6. #6
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    1. Do you have a matching field [EmployeeID, perhaps?] in each of your tables?
    2. What are you getting now when you run your Main Form & Sub Form? Is your Subform showing ANY records that match what you select in your Main Form?
    3. Have you created a Relationship between your two Tables?
    4.
    I want the subform to list ALL (past, present and future) dates in the 'Days' table.
    Do you mean you want the Sub Form to show all dates for the EmployeeID selected in the Main Form - or ALL records in the Days Table [for ALL EmployeeIDs]?

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Try setting something like this up:

    tblEmployees
    EmpID EmpFN EmpLN ----> other relevant fields

    tblAbsentReason
    AbsID AbsReason
    1 Sick
    2 Vacation
    ..etc

    tblAbsentDays
    ADID EmpID AbsDay AbsID

    You do not need to store results for every single person for every single day, you will end up with a lot of useless data because employees are at work 7 - 10 times more often than they are off work.

    You So your main form would be based on the employee, your subform would just be a list of the days they were off, if you link the main form to the subform through the EMPID you only have to enter the day they were absent and the absent reason. Any reporting or queries etc can be done or devised to handle 'exception' data collection.

  8. #8
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Here's a quick and easy example

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

Similar Threads

  1. Form Design Question with DLookup (newbie)
    By wongc61 in forum Access
    Replies: 4
    Last Post: 07-08-2011, 03:22 PM
  2. Controlling Subform from Main Form
    By SteveF in forum Forms
    Replies: 5
    Last Post: 07-01-2011, 05:32 PM
  3. Subform in a Tab Control on a Main form
    By jpkeller55 in forum Access
    Replies: 4
    Last Post: 01-08-2011, 12:31 PM
  4. Subform won't display in main form
    By Lynn in forum Forms
    Replies: 15
    Last Post: 03-22-2010, 10:17 AM
  5. Subform vs main form calculation
    By fadone in forum Forms
    Replies: 17
    Last Post: 12-21-2005, 07:27 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