Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need event to change form color

Status
Not open for further replies.

doerfohio

Technical User
Aug 30, 2004
34
US
My SignInForm has the following event code to change the color of the ExpirationDate field if the record's expiration date is passed. I'd like the whole form color to change instead of just the one field.

' Display Expiration date field in Red if Expired
'----------------------------------------------
If Me.ExpirationDate.Value <= Date Then
Me.ExpirationDate.BackColor = 255
Beep
Else
Me.ExpirationDate.BackColor = 16777215
End If

Thanks for your help!
 
How are ya doerfohio . . .

You need to [blue]change the backcolor of the sections[/blue] of the form:
Code:
[blue]   Dim bckColor As Long
   
   If Me.ExpirationDate <= Date Then
      bckColor = 255
   Else
      bckColor = 16777215
   End If
   
   Me.Section("Formheader").BackColor = bckColor
   Me.Section("Detail").BackColor = bckColor
   Me.Section("FormFooter").BackColor = bckColor[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Ok, I know this is a stupid question...should I copy and paste it just how you have it? I tried that but it gets hung up as soon as it gets to
Me.Section("Formheader").BackColor = bckColor

What am I doing wrong?
 
Try this instead:
Me.Section(acDetail).BackColor = 255

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
doerfohio . . .

If you don't have [blue]form header & footer[/blue] you don't need those lines . . . just the details.

Calvin.gif
See Ya! . . . . . .

Be sure to see FAQ219-2884:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top