Changing Form background color conditional format

  • Thread starter Thread starter Stephanie
  • Start date Start date
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.
 
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
 
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.
 
Back
Top