Controlling Subform Text Box Colors from the Parent Form

D

Don

(Originally posted to microsoft.public.office.access.forms, but
redirecting the discussion here)

Is it possible to control the background color of a text box on a
subform from the parent form? If so, would someone kindly throw me a
bone as I have not been able to figure it out.

Thanks!

Don
 
J

Jeanette Cunningham

Hi Don,
if the subform is continuous view, you can try using conditional formatting
in the subform - don't know what you are trying to do so this may not work.

If it is single view, you can use syntax like this
Me.[SubformControlName].Form.[ControlName].BackColor = lngMyColor

Note:
Replace the obvious with the names of your objects and variables.
SubformControlName is the name of the control on the main form that holds
the subform and may be different from the name of the subform inside that
control.
You will need to set the value of lngMyColor to whatever color you need.


If you use the above syntax for a continuous subform, every row will be
affected by the color change.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
P

Piet Linden

(Originally posted to microsoft.public.office.access.forms, but
redirecting the discussion here)

Is it possible to control the background color of a text box on a
subform from the parent form?  If so, would someone kindly throw me a
bone as I have not been able to figure it out.

Thanks!

Don

This might be helpful...
http://www.mvps.org/access/forms/frm0031.htm
"Refer to Form and Subform properties and controls"
 
D

Don

Hi Don,
if the subform is continuous view, you can try using conditional formatting
in the subform - don't know what you are trying to do so this may not work.

If it is single view, you can use syntax like this
Me.[SubformControlName].Form.[ControlName].BackColor = lngMyColor

Note:
Replace the obvious with the names of your objects and variables.
SubformControlName is the name of the control on the main form that holds
the subform and may be different from the name of the subform inside that
control.
You will need to set the value of lngMyColor to whatever color you need.

If you use the above syntax for a continuous subform, every row will be
affected by the color change.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia




(Originally posted to microsoft.public.office.access.forms, but
redirecting the discussion here)
Is it possible to control the background color of a text box on a
subform from the parent form?  If so, would someone kindly throw me a
bone as I have not been able to figure it out.

Don- Hide quoted text -

- Show quoted text -

Jeanette,

Exactly what I needed!

Thanks!

Don
 

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