Changing Form background color conditional format

S

Stephanie

I am trying to fingue out how to get the conditional format for a Form. There
is a field called [Reason For Test] and I am trying to write the code so that
when someone chooses "Applicant" the form page (not continuous) background
color is Green, and when they choose "Allied Agency" the form page background
color is blue.

I would really appreciate help with this.
 
G

George Hepworth

Forms, to my knowledge, don't have a conditional format property.

You'll need to add a small bit of code to the After_Update event of this
control ([Reason For Test]) to change the background color of the detail
section of the form (and the form header and footer if they are displayed).


Private Sub Reason_For_Test_AfterUpdate()
If Me.Reason_For_Test = "Applicant" Then
Me.Detail.BackColor =vbGreen
ElseIf Me.Reason_For_Test = "Allied Agency" Then
Me.Detail.BackColor = vbBlue
End If
End Sub

You probably need this on the form's Current event as well.

George
 
D

De Jager

Stephanie said:
I am trying to fingue out how to get the conditional format for a Form.
There
is a field called [Reason For Test] and I am trying to write the code so
that
when someone chooses "Applicant" the form page (not continuous) background
color is Green, and when they choose "Allied Agency" the form page
background
color is blue.

I would really appreciate help with this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top