I have a form with a subform. I want to be able to page down to new records from the form, but also enter through each field on the form and the subform and then, hitting enter, go on to the next record on the main form.
I open the form using:
DoCmd.OpenForm "Payment Data Entry-1grp1Location" which is a query. My form and subform are linked by the field
clh-claim-ws-no.
With my cursor in the form, I can page down through each record in the query result.
When I enter though the form and then the fields in the subform, and my cursor leaves the last field in the subform, I want it to go the first field in the main form, which is clh-claim-ws-no and show the next record. My code reads
'Private Sub Dis_reason_LostFocus()
Forms![payment data entry-all unpaid claims]![CLH-CLAIM-WS-NO].SetFocus
DoCmd.GoToRecord , , acNext
End Sub
This works fine until I get to the last record of the query result. I have tried to use some variation of EOF - movefirst but since I never defined a recordset, this won't work.
Where do I go from here?
I open the form using:
DoCmd.OpenForm "Payment Data Entry-1grp1Location" which is a query. My form and subform are linked by the field
clh-claim-ws-no.
With my cursor in the form, I can page down through each record in the query result.
When I enter though the form and then the fields in the subform, and my cursor leaves the last field in the subform, I want it to go the first field in the main form, which is clh-claim-ws-no and show the next record. My code reads
'Private Sub Dis_reason_LostFocus()
Forms![payment data entry-all unpaid claims]![CLH-CLAIM-WS-NO].SetFocus
DoCmd.GoToRecord , , acNext
End Sub
This works fine until I get to the last record of the query result. I have tried to use some variation of EOF - movefirst but since I never defined a recordset, this won't work.
Where do I go from here?