Hi everyone, I'm new here and fairly new to Access and I need some advice! Okay, here is what I'm trying to accomplish:
I need to make a database that records our employee hours and production results on a daily basis. At the end of any given time period, I need to be able to pull up employee hours and production data for a variable period of time.
I've created tables and made a form to where a user can add new employees to the database. I need to make another form that uses the employees entered into form 1 (add new employee) and lists them in form 2 (enter employee hours) with a text field behind each employee name for inputing their hours. Is this possible?
You don't need another form; you need a sub-form. In short,
1 - make another table with the employee id# from table1, and whatever fields you need to record the hours, such as from date, from hour, to date, to hour, etc. Make sure to give it a primary key index. Also, make sure that table1 has a pk index, such as the employee id#.
2 - In the relationships screen, make a one-to-many relationship from table1 employee id# to table2's foreign key (which is, of course, also the employee id#). Set cascading updates to true.
3 - make a data-entry form for table2 data; condense it (in size) as much as possible. Save and close it.
4 - With the first form open, create a sub-form with the sub-form wizard, and use the form created in step 3 as the sub-form. The relationship is the same as with the tables: parent employee# to child foreign key (employee id#).
When you open the main form, the sub-form will open as well, and will allow you to make entries.
Perhaps before you attempt the above, you should read about relationships and sub-forms in the Help file. It's a very helpful tool.