Results 1 to 10 of 10
  1. #1
    CSJH is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    5

    Form fields auto-populating

    I am creating a basic form using one table for entering daily hours worked per person with multiple projects. I need to have enough lines for each record for an 8 hour day which may include several projects in one day. I added combo boxes to the form and I can use the same category or different categories with no problem. My problem is the "hours worked" field. How do I have that field multiple times on the same form without it auto populating the same number to all the fields on the form? I feel like this is probably a simple answer but I can't figure it out...



    Thanks in advance

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    remove the text box default value,
    or
    run an update query to set the text box value after the form loads.
    (it wouild update all HrsWorked=0)

  3. #3
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    Sounds like you need more then 1 table?
    tblEmployee (EmpID(auto), EmpName)
    tblProjects (ProjectID(auto), ProjectName)
    tblProjectsWorked (ProjectsWorkedID(auto), EmpID, ProjectID, HoursWorked)
    Form based on tblProjectWorked, use combo boxes to select Employee and Project. Then link all 3 in query by EmpID and ProjectID to get all data for reporting.

  4. #4
    CSJH is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    5
    Thank you but I still can't get the hours worked field to stop auto populating the same number for all of the fields. It seems like such a simple problem that I can't fix.

  5. #5
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    Are all the hours worked fields on the form bound to the same field (Control Source in properties) in the table? If you just copied that field multiple times, you have to go in and point to the different HoursWorked fields in your table if that is how you have it set up.

  6. #6
    CSJH is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    5
    I am sorry I still don't understand. I have one HoursWorked filed in my table. If I add 8 fields of hours worked to the table will that give accurate data when running reports?

  7. #7
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    Can you give an example of your data in the table and how it is on the form?

  8. #8
    CSJH is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    5
    Here are my tables:
    Table: Employee
    EmployeeID (PK) Auto Number
    FirstName Short Text
    LastName Short Text
    Table: Funds/Projects
    FundID (PK) Auto Number
    Funds/Projects Short Text
    FundCategory Short Text
    Table: Hours
    TimeLogID AutoNumber
    DateWorked Date/Time
    EmployeeID Short Text
    FundID Short Text
    TaskID Short Text
    HoursWorked Number
    Table: Tasks/Activities
    TaskID (PK) Auto Number
    Tasks/Activities Short Text
    TaskCategory Short Text
    I want to create a simple form each employee fills out daily, enters their name and the date.
    They then have the option to use drop downs to select a fund/project and a task/activity. On the same line they need to enter time worked in half hour increments.
    So it should look like this.
    John Smith Week Ending 4/7/17
    Coin General 0:30
    Operating General 2:30
    Administration Sick Time 4:30
    Administration Staff meeting 0:30
    Total: 8:00
    I have the form the way I want it but I can't get the hoursworked fields to be separate from each other without autopopulating.

    Can you please tell me if there is a problem with my tables or maybe it's a relationship problem??

    Thank You!!

  9. #9
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,471
    Your Foreign key fields in the related tables should be numeric, not text as they have to link back to autonumber(numeric) fields.

    So do you have a main form to enter Name and Date, then subform to enter Project, Task and Hours?

  10. #10
    CSJH is offline Novice
    Windows 10 Access 2016
    Join Date
    Mar 2017
    Posts
    5
    Thank you for the help, I will check that and try again.

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

Similar Threads

  1. Auto populating on a Form
    By Canadiangal in forum Forms
    Replies: 1
    Last Post: 03-28-2013, 04:54 PM
  2. Auto Populating a new form
    By mikejames in forum Access
    Replies: 12
    Last Post: 09-25-2011, 11:41 AM
  3. Replies: 1
    Last Post: 09-08-2011, 06:36 PM
  4. Auto populating fields from MS access
    By fawazeto in forum Forms
    Replies: 0
    Last Post: 04-04-2011, 08:25 PM
  5. Auto populating Form controls
    By eww in forum Forms
    Replies: 1
    Last Post: 08-09-2010, 12:49 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