Subform to open on new record

My mother form has a comments form which links to the tblComments.
The mother form also has a control that opens a daughter form which also has a similar comments form on it.
Presently when I make a comment while on the mother form and then navigate to the daughter form, the same comment that was active on the mother form is still active.
The same is the case if I make a comment on the daughter form and navigate to the mother form.
I want that each time the mother form opens, the comments form must open in a new record and vice versa.
I attach my database.
It opens on form "Process WIP Vessel Documentation". The comments form is at the bottom.
When you click on "General Information" control, the general Information form opens. The comments form is at the bottom. db2.mdb
Fritz PaulAsked:
Who is Participating?
 
mbizupConnect With a Mentor Commented:
So this would go in the open event of frmNewVesselGenInfo:
Private Sub Form_Open(Cancel As Integer)
'    ci_CenterIt Me, True, 3
    Me.frmtblComments.SetFocus
     DoCmd.GoToRecord , , acNewRec
End Sub

Open in new window


And this would go in the open event of frmProcWIPVessel:

Private Sub Form_Open(Cancel As Integer)
    Me.frmtblCommentsForfrmProcWIP.SetFocus
    DoCmd.GoToRecord , , acNewRec
End Sub

Open in new window

0
 
mbizupCommented:
Add the following code to the Open event of your main form:

     Me.frmtblComments.SetFocus
     DoCmd.GoToRecord , , acNewRec

Open in new window


(You would use similar code in both forms - just specifying the appropriate subform name for each)
0
 
Fritz PaulAuthor Commented:
Thanks a lot.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.