I have a form that I would like to use to update training information for my company's employees. There are two cases:
1) The employee already has a record for the training but the date needs to be changed.
2) The employee needs a record added for that training.
In the form I have combo boxes for selecting the employee and the specific training from existing tables. If a training record exists for that employee/training combination, I would like the date_completed to auto-populate. Otherwise, I would like a record to be created in the appropriate table.
I think I can use SearchForRecord to locate the correct record in the training completed table and pull the date from there, but I'm not sure how to phrase the code.
Create the Comboboxes for Employee/training (Unbound) on the Header section of a Form (say Main Form).
Design a Form on the Training Completed Table and insert it in the Detail Section of the Main Form.
Use the Combobox references as Link Master Field Property value of the Sub-Form.
Use corresponding field references from Training Completed Table in the Link Child Field Property value of the Sub-form.
Save the Main Form with the Sub-Form.
When you select values from the Comboboxes on the Main Form it's corresponding record, if available in the Training Completed Table, will automatically populate in the sub-form, otherwise the sub-form will be empty.