linanderson
Registered User.
- Local time
- Today, 14:37
- Joined
- Jul 13, 2002
- Messages
- 17
Hello,
I have been looking at pasts threads concerning changing text colour in one field on a form, dependent on the value in this field.
The fields (from a query) calculates an age at retirement. If this age equals or is greater than 65, I would like to show the answer in red. If not the answer should be in the default black. At present I have no default value in the field and the associated retirement date and date of birth fields are not mandatory. The format is in "yy" and "mm".
I have experiemented but not been successful yet. Apologies, I am new to writing code.
If Me![AgeAtRetirement] >=65 Then
Me![Name].ForeColor = (255)
Else
Me![Name].ForeColor = (0)
End If
Also, where is the correct place to place this code. Before Update?
Any pointers welcome.
Thanks
I have been looking at pasts threads concerning changing text colour in one field on a form, dependent on the value in this field.
The fields (from a query) calculates an age at retirement. If this age equals or is greater than 65, I would like to show the answer in red. If not the answer should be in the default black. At present I have no default value in the field and the associated retirement date and date of birth fields are not mandatory. The format is in "yy" and "mm".
I have experiemented but not been successful yet. Apologies, I am new to writing code.
If Me![AgeAtRetirement] >=65 Then
Me![Name].ForeColor = (255)
Else
Me![Name].ForeColor = (0)
End If
Also, where is the correct place to place this code. Before Update?
Any pointers welcome.
Thanks