GoToControl problems in a macro

G

Guest

I'm trying to use a macro so that when closing there is a GoToControl that
goes to a subform and then GoToControl again goes to a field within that
subform. I want to check other fields to ensure they are completed if the
first field is not null. On my second GoToControl that takes the user to the
'name' field in the subform I get an error message telling me the object
doesn't contain the automation object 'name'. The cursor is on this field
however. This field is updatable, visible and not locked. Any idea on 1. why
the message and 2. how to get rid of it?
 
S

Steve Schapel

Cheryl,

'Name' is a Reserved Word (i.e. has a special meaning) in Access, and as
such should not be used as the name of a field or control or database
object. There is a chance that this is contributing to the problem.
Otherwise, I think you might need to refer in full to the control in the
second GoToControl, i.e.
[Forms]![YourMainForm]![SubformControl]![NameControl]
 
G

Guest

Actually I just picked 'name' as the name for my question. 'Reg eff' is the
actual name. I'll try your suggestion. Do I need to change the name to be
one word perhaps?
--
Cheryl


Steve Schapel said:
Cheryl,

'Name' is a Reserved Word (i.e. has a special meaning) in Access, and as
such should not be used as the name of a field or control or database
object. There is a chance that this is contributing to the problem.
Otherwise, I think you might need to refer in full to the control in the
second GoToControl, i.e.
[Forms]![YourMainForm]![SubformControl]![NameControl]

--
Steve Schapel, Microsoft Access MVP

I'm trying to use a macro so that when closing there is a GoToControl that
goes to a subform and then GoToControl again goes to a field within that
subform. I want to check other fields to ensure they are completed if the
first field is not null. On my second GoToControl that takes the user to the
'name' field in the subform I get an error message telling me the object
doesn't contain the automation object 'name'. The cursor is on this field
however. This field is updatable, visible and not locked. Any idea on 1. why
the message and 2. how to get rid of it?
 
S

Steve Schapel

Cheryl,

As long as you put []s around the name of the control, it shouldn't
matter to have a space in it.

As an aside... it's always a good idea to use actual examples when
asking for technical help :)
 

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

Similar Threads

GoToControl troubles 2
Access 2002 macro - Using GoToControl 3
SetProperty Action in Macro 6
GOTOCONTROL 3
goToControl 1
GotoControl and Subforms 9
Copy from Form to Subform 2
FindRecord 2

Top