How to refer to a control on the child form?

G

Guest

Hi
Can anyone tell me how to refer to a ComboBox on my child form from my main
form, I write the following codes in a Command button on my main form and it
doesn't work.

Me!MyChildFrom.cbxItem.Datasource = ‘1;2;3;’

Thank you
 
A

Allen Browne

Try:
Me!MyChildFrom.Form.cbxItem ...

If the .Form bit is new, see:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html

Also, be aware that the subform control may have a different name than the
form that is loaded into it (its SourceObject.)
 
S

Stefan Hoffmann

hi Jeff,
Can anyone tell me how to refer to a ComboBox on my child form from my main
form, I write the following codes in a Command button on my main form and it
doesn't work.

Me!MyChildFrom.cbxItem.Datasource = ‘1;2;3;’
You have to use the subform control name, not the name of the (sub-)form
itself.


mfG
--> stefan <--
 

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