On Enter Color

W

williamr

I'm trying to change the color of a text box when the user tabs into it.
It's a subform but I can't make it work. I'm using this format:
Forms!Name![Slips Subform].Date1.BackColor = RGB(255, 0, 0)
where 'Name' is the form & 'Slips' is the subform.

Thanks
 
K

kingston via AccessMonster.com

Try the Conditional Formatting option via the Format menu. Use the condition
Field Has Focus. No code necessary. HTH.
I'm trying to change the color of a text box when the user tabs into it.
It's a subform but I can't make it work. I'm using this format:
Forms!Name![Slips Subform].Date1.BackColor = RGB(255, 0, 0)
where 'Name' is the form & 'Slips' is the subform.

Thanks
 
D

Douglas J. Steele

Forms!Name![Slips Subform].Form.Date1.BackColor = RGB(255, 0, 0)

Make sure, too, that the name of the control that holds the subform is
[Slips Subform]. The name of the subform control isn't always the same as
the name of the form being used as a subform. If they're different, you need
to use the name of the subform control.
 
W

williamr

Thank You very much

Douglas J. Steele said:
Forms!Name![Slips Subform].Form.Date1.BackColor = RGB(255, 0, 0)

Make sure, too, that the name of the control that holds the subform is
[Slips Subform]. The name of the subform control isn't always the same as
the name of the form being used as a subform. If they're different, you need
to use the name of the subform control.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


williamr said:
I'm trying to change the color of a text box when the user tabs into it.
It's a subform but I can't make it work. I'm using this format:
Forms!Name![Slips Subform].Date1.BackColor = RGB(255, 0, 0)
where 'Name' is the form & 'Slips' is the subform.

Thanks
 
Top