GoToControl problems in a macro

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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]
 
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?
 
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 :-)
 
Back
Top