Change Textbox ForeColor property on Form

djpearce

Bamedele
Local time
Today, 05:11
Joined
May 12, 2004
Messages
27
I have a simple 8-fields form bound to a table. I want to change the fore color property for each field if a check box is clicked. I am creating an “on-click” sub. When I type “Me!PensionNo.”, 2 of my 6 text fields do not allow me to change the color; in fact, it only shows “value” in the drop down list. I have checked the properties in the table and these 2 fields are no different from other fields that display a long list of properties. Can anyone tell me why? See code below. Lines that are commented out (') are problem lines:
If Signed = -1 Then
Me!Department.ForeColor = lngRed
'Me!PensionNo.ForeColor = lngRed
Me!SSN.ForeColor = lngRed
'Me!LastName.ForeColor = lngRed
'Me!FirstName.ForeColor = lngRed
'Me!MiddleInitial.ForeColor = lngRed

Me!PED.ForeColor = lngRed
Me!Signed.BorderColor = lngRed
 
Last edited:
AHA! I discovered that the .Name property value had a space between tow-word field names. For example, PensionNo was typped as "Pension No", FirstName as "First Name" ...

Thanks to all who tried this.
 

Users who are viewing this thread

Back
Top Bottom