AcNext on subform doesn't work!

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.
 
S

Steve Schapel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top