locked
Single combo box selection populates a field for all records on multiple item form? RRS feed

  • Question

  • Working on a timesheet entry and approval setup. 

    For the Timesheet entry form(multiple item form), I would like the employee selection in the header to populate all records on the form. Currently I must re-select the employee for each row of the form. 

    This form references a query that links the employees and timesheets tables. 
    Tuesday, February 13, 2018 5:12 PM

All replies

  • Hi,

    To help us picture what you are describing, can you post a screenshot of your form? Thanks.

    Tuesday, February 13, 2018 5:20 PM
  • You can use a subform in an unbound parent form which contains an unbound combo box to select the employee.  For the LinkMasterFields property of the subform control reference the unbound combo box, and set the LinkChildFields property to EmployeeID or whatever is the name of the column in the subform's recordset.  By virtue of the linking mechanism the same EmployeeID value will be inserted into the column when you insert a new row in the subform.

    You'll find an example In Timesheet.zip in my public databases folder at:

    https://onedrive.live.com/?cid=44CC60D7FEA42912&id=44CC60D7FEA42912!169

    Note that if you are using an earlier version of Access you might find that the colour of some form objects such as buttons shows incorrectly and you will need to  amend the form design accordingly.  

    If you have difficulty opening the link, copy the link (NB, not the link location) and paste it into your browser's address bar.

    In this little demo file select Timesheet in the opening menu form, which will open a form set up in the way described above.  The form contains two subforms in my case, one for worked time the other for paid unworked time such as annual leave or sick leave.

    Ken Sheridan, Stafford, England

    Tuesday, February 13, 2018 5:27 PM