I have a main form called frmWorkMain that has a record source based on an SQL statement from three tables -("tblClients, tblWorkRecord and tblWorkDetails". There is a subfrm that shows (one-to-many) the details of work carried out for a specific job. So for example a Job record may have a number of works undertaken for the same job but on different days. The record source for the sub form is simply the work details table tblWorkDetails. the master/child links are based on the InvoiceNo field. Some jobs may require a visit to the site so I have a seconf form with sub form that allows records for mileage to be input. This form is accessed via a link on a label: the underlying code at present in the OnClick event is:
Private Sub lblOpenMileageForm_Click()
DoCmd.OpenForm "frmMileageMain", acNormal, , , acAdd, acDialog, NewData
End Sub
frmMileageMain has a subfrm that lists all the journeys taken for that invoice.
What I want is that when the label to open the mileage form is clicked it opens to the invoice record from the frmWorkMain.
How do I achieve this please?
Private Sub lblOpenMileageForm_Click()
DoCmd.OpenForm "frmMileageMain", acNormal, , , acAdd, acDialog, NewData
End Sub
frmMileageMain has a subfrm that lists all the journeys taken for that invoice.
What I want is that when the label to open the mileage form is clicked it opens to the invoice record from the frmWorkMain.
How do I achieve this please?