Go to New Record in subform

K

Kathy

I posted this in the Forms Programming group, but no
response yet. Maybe this is a better newsgroup for this
question. I have a main Form with two subforms. I want
to add two Command Buttons; one Command Button to go to a
new record in Subform A and the other Command Button to go
to a new record in Subform B. When I try to build a Go To
Record macro, it tells me I am referencing an object that
is not open (I guess that would be the subform). If I
build a macro that first executes the Open Form action to
open the subform, it opens a separate subform rather than
the one embedded in my main form. Maybe I need to program
it in Visual Basic, but I am not sure how to do this.
Basically I am trying to move from the main form to the
first empty row in a subform. Any suggestions?
 
K

Ken Snell

Which version of ACCESS are you using? I have found that ACCESS 2000 is not
good for this type of action; 2002 is better.

Post the exact actions that you're trying to use in the macro. Did you set
"focus" (GoToControl) on the subform before you do the GoToRecord action?
 
K

Kathy Ratermann

Thanks for the info Ken. I am using Access 2000. Someone
responded on the other newsgroup and had the answer for
me. I wasn't treating the subform as a control, like I
should have. I did it in VB, using the following:

DoCmd.GoToControl "subform name"
DoCmd.GoToRecord , , acNewRec

I tried it and it worked!!

Thanks,
Kathy
 

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