GotoControl Action

R

Russ

I'm trying to assign a GotoControl Action macro to a button. I'm
wanting the focus to go to a subform of a form where the button is.

I've read in 2000 help the following:

Tip You can use the GoToControl action to move to a subform, which
is a type of control. You can then use the GoToRecord action to move
to a particular record in the subform. You can also move to a control
on a subform by using the GoToControl action to move first to the
subform and then to the control on the subform.

But, when I run the macro with the button, I get an error saying it
there is no field with that name in the current record. I've entered
the subform's name in the macro's control name area, and tried various
syntaxes including just the simple name. This macro will work if I
enter a field name in the main form, but will not work using the
subform name.

Russ
 
T

tina

well, the concept works (though you don't have to include a GoToRecord
action unless you specifically need to go to a particular record each time).
so i'm guessing you're not using the right subform control name - a common
mistake in working with subforms.

the subform actually sits in a CONTROL on the main form. this control
sometimes has the same name as the subform itself, and sometimes a different
name. to get the correct name of the subform CONTROL: open the main form in
design view and select the subform (within the main form). in the Properties
box, click the Other tab and look at the Name property. that's the name you
want to use in the macro's first GoToControl action.

hth
 
R

Russ

That's what I did Tina. I checked and re-checked my spelling too and
that didn't help. Then I redid the macro, and applied it back to the
button and somehow it worked this time. Something I did messed up and
I don't know what. Thanks

Russ
 
T

tina

you're welcome


Russ said:
That's what I did Tina. I checked and re-checked my spelling too and
that didn't help. Then I redid the macro, and applied it back to the
button and somehow it worked this time. Something I did messed up and
I don't know what. Thanks

Russ
 

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