Conditional Format – Access 97

5 pts.
Tags:
Access 97
Conditional formatting
Microsoft Access
Unfortunately, the company I work for uses Access 97, and the Conditional Format Wizard is not available in this version. Can you help me with building a macro/expression to create a conditional format for a form? I need to format the form's background color based simply on whether the record is "Active" vs. "Inactive." Thanks, Alayne
ASKED: October 29, 2008  6:07 PM
UPDATED: October 30, 2008  3:49 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

In the form’s on current trigger, simply check the Active / inactive field and set the background property of the detail section accordingly. You can do it in a Macro or VBA code. I put a VBA code example below.

Private Sub Form_Current()
If Me![active] Then ‘ <active] is a bound field to recordsource
Me.Section(0).BackColor = 255 ‘set detail section to red when active
Else
Me.Section(0).BackColor = -2147483633 ‘set detail section to standard gray when not active
End If
End Sub

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following