SetValue macro on subform

V

Volta

I attached a SetValue macro to an "On Enter" event procedure for a field on
a subform. When I am working with the subform independent of the "master"
form that it is linked to, the macro works fine. But if I then access the
subform through its "master" form, it does not recognize the name of the
subform used in building the macro.
 
A

Allen Browne

A subform is not open in its own right, i.e. it is not part of the Forms
collection.

The easiest solution would be set the On Enter property to [Event Procedure]
instead of a macro. In the code window, add the line:
[PutTheNameOfYourControlHere] = 9999
If it is text, but the value in quotes.
 
V

Volta

Thank you Mr. Browne! It is working! I appreciate your time in responding.

Allen Browne said:
A subform is not open in its own right, i.e. it is not part of the Forms
collection.

The easiest solution would be set the On Enter property to [Event Procedure]
instead of a macro. In the code window, add the line:
[PutTheNameOfYourControlHere] = 9999
If it is text, but the value in quotes.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Volta said:
I attached a SetValue macro to an "On Enter" event procedure for a field on
a subform. When I am working with the subform independent of the "master"
form that it is linked to, the macro works fine. But if I then access the
subform through its "master" form, it does not recognize the name of the
subform used in building the macro.
 

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