gotorecord for a subform?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

What is the syntax for using gotorecord for a subform. If I use if for the
root form all is well, but for a subform the error message says that the form
is not open (I am assuming that it can't see it).
for example:
docmd.GoToRecord acDataForm,"subform",acNext

I assume that the problem is that I cannot just give the subform name, so
how do I identify it?

thanks,
 
Are you running the code in the context of the Main Form, e.g. the code in a
CommandButton on the Main Form?

If that is the case, try:

Me.SubformCONTROLName.SetFocus
DoCmd.GoToRecord , , acNext

You need to check the SubformCONTROLName in the DesignView of the Main Form
since it may be different from the name of the Form being used as the
Subform.
 
Back
Top