form question

bam12

Well-known Member
Joined
Dec 6, 2004
Messages
984
If i do the following, will this make a form for each employee or will it make one for all?

Sorry this post is part of another thread

You're on the right track. Make an Employees table with just employee data. Make a Tasks table with just task information. Each of these will have a primary key; EmployeeID, TaskID (both AutoNumber).
to assign and track tasks, build an Assignments table with at least these fields:
AssignmentID (primary key, Autonumber)
EmployeeID (Number)
TaskID (Number)

In Relationships view, join Employees to Assignments on EmployeeID, and enforce referential integrity. Also join Tasks to Assignments on TaskID and enforce referential integrity.

The Assignments table can have other fields directly related to the assignment; AssignedDate (Date/Time)
CompletedDate (Date/Time)
AssignmentNotes (Memo)
...and maybe some others that you can think of.

Data entry --
Build frmEmployees, based on the Employees table. Single record per page.
Build sfmAssignments, based on the Assignments table. Datasheet view.

In Design view on frmEmployees, press F11 to bring the database container to teh front. Drag the sfmAssignments table onto frmEmployees, and let go.
IMMEDIATELY click the Properties button, go to the Data tab, and check to see that the Master and Child fields are populated. They should both be EmployeeID -- enter the field names if they are blank.

Take a look. You will see a Datasheet view where any tasks you enter in the subform will be asssigned to the current employee. You can (and should) make your life easier by modifying the subform so that the TaskID field is a combo box, not a text box. This wll let your users pick a task description, while storing just the ID for later use.

Down the track you can build queries around the Assignments table, for reporting on employees by task, tasks by employee, and a range of other stuff.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
One form will hold all of the employee data. It will link to a form that will show all of the tasks for that employee. Switch to a new employee record, and you will see tasks for the employee that you selected.
It's possible to build a search box so you can just go to a particular employee without browsing all records first.

If you are new to Access I'd recommend picking up a copy of Grover Park George on Access (go to the MrExcel Store). It gives a solid background.

Denis
 
Upvote 0
the reason I ask that question, was now they want to track the employee's times and production for each day and to verify that the time adds up to 7.5 hours
 
Upvote 0
OK, assuming that you have a field in the subform called WorkHours.
In the footer of the subform, insert a textbox and call it txtTotalHours. The Control Source needs to be an expression like this:
=SUM(NZ([WorkHours]))

Save the subform. Now open the main form in Design view, select the Subform, and look for the name that displays in the top left corner of the screen -- the equivalent of the Name box in Excel. That is the name of the container that holds the subform, and you need it for the next part. Let's say that the container name is tblAssignments (it is unlikely to be the name of the subform itself).

In the main form, add another textbox. The Control Source for this should be
=[tblAssignments].Form![txtTotalHours]

You'll need to change names to suit your forms / fields etc, but that is how you get a summary value from a subform up to the main form.

Denis
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,013
Members
448,935
Latest member
ijat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top