Setvalue Macro to a Subform

  • Thread starter Thread starter Mark S
  • Start date Start date
M

Mark S

I don't usually have problems with simple setvalue maccros but this one
confuses me. I am using Access 2002 and bring information from a simple open
form and trying to populate a subform on another open form.

The information is being transferred but it only appears after I change the
record and return to prior record that was open on the setvalue macro

For example :
Forms![FormMain]!SubMain]![Nutrition]
Forms![FormSecondary]![Formula]

When I do this on form field not in a subform I see the information
instantly. I suspect it has something to do with the subform but I don't
know what. Any advice appreciated.

*****************************************
Mark M S
 
Reference to a subform must go through the main form in which the subform is
embedded:

Forms!MainFormName!SubformName!ControlOnSubform

where SubformName is the name of the subform control (the control that
actually holds the subform object) on the main form -- note that the name of
this control may or may not be the same as the Source Object of that
control.
 
Thanks It worked perfectly. In this case it seemed redundant but was
accurate

Forms![FormMain]![Nutrition]![Nutrition]

--
*****************************************
Mark M Simonian MD FAAP
681 Medical Center Dr West #106
Clovis, CA 93611
(559) 325-6850
www.markmsimonian.medem.com
Ken Snell (MVP) said:
Reference to a subform must go through the main form in which the subform
is embedded:

Forms!MainFormName!SubformName!ControlOnSubform

where SubformName is the name of the subform control (the control that
actually holds the subform object) on the main form -- note that the name
of this control may or may not be the same as the Source Object of that
control.

--

Ken Snell
<MS ACCESS MVP>

Mark S said:
I don't usually have problems with simple setvalue maccros but this one
confuses me. I am using Access 2002 and bring information from a simple
open form and trying to populate a subform on another open form.

The information is being transferred but it only appears after I change
the record and return to prior record that was open on the setvalue macro

For example :
Forms![FormMain]!SubMain]![Nutrition]
Forms![FormSecondary]![Formula]

When I do this on form field not in a subform I see the information
instantly. I suspect it has something to do with the subform but I don't
know what. Any advice appreciated.

*****************************************
Mark M S
 
Back
Top