Hi
Sorry about that
I have 1 form which is linked to tbl_StoreLicences while the subform is
linked to tbl_Licences.
What happens is the main form has text boxes which we enter data into and
once completed we click on a command button (located in the header of
mainform) which then sets the focus onto the subform and at the same time
updates the tbl_StoreLicences.
What happens then is we need to populate the text boxes on the subform and
once complete we need to click on the command button (located in the header
of Subform) which should then update the tbl_Licences and also set the focus
back to the main form and hide the subform.
the second is where I am having problems as it doesn't work.
Below is the code:
Main form:-
Public Sub cdmAdd_Click()
On Error GoTo Err_cdmAdd_Click
dbID = ID
Form_frm_Update2nd.Visible = True
Form_frm_Update2nd.ID = dbID
Forms!frm_Update1st!frm_Update2nd.SetFocus
Forms!frm_Update1st!frm_Update2nd.Form!ExpiryDate.SetFocus
Exit_cdmAdd_Click:
Exit Sub
Err_cdmAdd_Click:
MsgBox Err.Description
Resume Exit_cdmAdd_Click
End Sub
Private Sub Form_Load()
Form_frm_Update2nd.Visible = False
DoCmd.GoToRecord , , acNewRec
End Sub
Subform :-
Private Sub cmdAddDetails_Click()
On Error GoTo Err_cmdAddDetails_Click
Me.Requery
Me.Parent.SetFocus
Me.Parent.Store.SetFocus
Me.Parent.Form_frm_Update2nd.Visible = False
Exit_cmdAddDetails_Click:
Exit Sub
Err_cmdAddDetails_Click:
MsgBox Err.Description
Resume Exit_cmdAddDetails_Click
End Sub
Private Sub Form_Load()
DoCmd.GoToRecord , , acNewRec
End Sub
Thanks
Noemi