AcNext on subform doesn't work!

  • Thread starter Thread starter Robert
  • Start date Start date
R

Robert

Hi,

I have a main form, lets call it formA. I also have a sub
form in formA, lets call it formB. In formB, I have a
command button that has the following code:

DoCmd.GoToRecord acDataForm, "formB", acNext

Basically when I click on this button the subform should
go to the next record. However I get the following error:

Run time error 2489 The object 'formB' isn't open.

I tried to fully reference the subform but still gave me
the same error. Can anyone help me on this Please.

Thanking you in advance
Robert.
 
Robert,

The error message is correct, FormB is not "open", it is just displayed
within the container of the subform control on FormA, which is open.

Since you are referring to a record on the subform, and the event is on
the subform, you don't need to specify. Try this...
DoCmd.GoToRecord , , acNext
 
Back
Top