Conditional Formatting in Access 97?

mohsinhq

Registered User.
Local time
Today, 16:32
Joined
Aug 2, 2004
Messages
90
Is it possible to format fields conditionally in access 97?

I am trying to change the font colour and font weight based on the value in the field?

Thanks in Advance
 
In the OnCurrent event of the form put

Code:
If Me.YourFieldName = "Something" Then

Me.YourFieldName.ForeColor = VbRed

Else

Me.YourFieldName.Forecolor = VbBlue

End If

Col
 
thanks alot for that. one other question..

ive tried making the field bold by:

if me.txtFieldname > 0 then

Me.txtfieldname.fontbold = true

end if

without any luck?

any ideas?
 
I've just tested this code and it works fine when I scroll from record to record

Code:
If Me.FirstName = "John" Then
Me.FirstName.ForeColor = vbRed
Me.FirstName.FontBold = False
Else
Me.FirstName.ForeColor = vbBlue
Me.FirstName.FontBold = True
End If

Not sure why yours is not working

Col
 
colin,

could it be because my form is showing records in continuous form view?
 

Users who are viewing this thread

Back
Top Bottom