Private Sub Command6_Click()
On Error GoTo Err_Command6_Click
Set rst = Me.prod_subfrm.Form.RecordsetClone
rst.Bookmark = Me.prod_subfrm.Form.Bookmark
rst.MoveNext
Me.prod_subfrm.Form.Bookmark = rst.Bookmark
Exit Sub
rst.Close
rst = Nothing
Exit_Command6_Click:
Exit Sub
Err_Command6_Click:
Resume Exit_Command6_Click
End Sub
In this case the main form was named FORM1 and the subform control on the main form was named prod_subfrm. The actual subform was named prod_subfrm9. I always try to name the control something other than the underlying subform's name. This ensures that the code can easily and uniquely identify what I really want rather on trying to decide on whether I meant the control or the subform contained in the control. This technique also works well for other field controls where there is a problem on what may be meant. I usually go to the control name and add a letter in front of the name (ie)the text box for the field Last_Name will be renamed to zLast_Name .
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.