We now want to create a form in which the Timesheet data can be entered. If we think about it an Employee would work on a Project so it would make sense that the primary form would be Employee (You would select the Employee then add the timesheet data).
To create a Many - many form we need to do this in two parts.
Create an Employee-Timesheet for
To the Timesheet subform allow the user to select the project from a drop-down list.
(If you want the subForm to display some of the Project attributes you should create a query linking the Timesheet- Project) then create the form (client) subform (queryTimeSheetProject, then in Design view disable the project attributes except for the ProjectID).
Using Create > Form Wizard create the Employee+Timesheet form/subform (Detailed instructions are given in the Employee/Assets form/subform)
You will need to go into design view to enlarge the Timesheet subform so that all the attributes are showing.
Recommendation: At this stage don't spend too much time prettying up your form, it is better to get it working first before spending time making it look nice.
We need to add this to the Timesheet subform (fsubEmployeeTimeSheet)
So that things don'e get confused for either you or MS-Access, close down the EmployeeTimesheet Form (frmEmployeeTimesheet). Access should ask you to save the form and subform.
Now open the subform (fsubEmployeeTimesheet) (1).
In the Design view, under Form Design (2) on the ribbon bar click on the Combo button (3), then drag this ont the form (4)
The Combo Box Wizard will appear, so make sure "I want the combo box to get the values from another table or query is checked (5), then click [Next] (6)
Note that if you try to add the Combo box when you have the Form and subform open the wizard will not work
Using the wizard get the combo box to select te ProjectID and place it into the ProjectID in the Timesheet subform.
Which Table or query should provide the values in the combo box? Choose Table: tblProject
Which fields contain values you want to show in the combo box? Select ProjectID, ClientID and ProjectDescription
Sort by ProjectID (You could change this to ProjectDescription)
Access will ask How wide would you like the columns. It would pay to make the ProjectDescription a bit wider. You can also Hide the Key Column (which is recommended)
The next step is really important, you are asked which attribute in the Timesheet table do you want to store the ProjectID from the Project table. This will be stored in the Timesheet ProjectID.
Finally you are asked to name the combo box object on your form. Enter ProjectID. This will return you back to the EmployeeTimeSheet subform.
Next tidy up the subform do you don't end up with two ProjectID's (so delete the original one and move the combo box)
Change to datasheet view and move the cobProject column to the right of EmpID
Close the subform (and save) then reopen the EmployeeTimesheet form. You should end up with the new subform in the EmployeeTimesheet form
This will now allow you to select from a combo box the project for the employee timesheet you are creating.
Once you have checked all is working tidy up the form.
You can add a list box so empluyees can be selected (This was shown in the original Client Entry Form MSA3c)