Access Subform Control

  • Thread starter Thread starter Scientific
  • Start date Start date
S

Scientific

Hello,

Using VBA coding, how do I change background color on a subform control.

Form name = Matrix
Subform name = sfrmAdvertise
Control name = cboProducts
 
Try:
Forms!Matrix!sfrmAdvertise.Form!cboProducts.BackColor = vbRed

For an explanation of the .Form bit, see:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html

At first, I read your question as referring to the subform control itself,
which doesn't have a BackColor. If that's what you meant, you would need to
set the BackColor property of the sections (e.g. Detail) of the form in the
subform control.
 
Allen,

Thank you very much. Your code worked perfectly and now I know an easy way
to reference controls on subforms which was a pain before. Boy do I ever
need to study more about VBA.

-Sci
 

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

Back
Top