fore color-continuous form

  • Thread starter Thread starter Junior
  • Start date Start date
J

Junior

Acc2K -Using a continuous form - i want to change the color of a txt box
(date) to red if the date is greater than another date txtbox - i put this
code in the forms current event - but this changes all txtcompl to red
what am i doing wrong?? thanks

Dim dtComp As Date, dtSusp As Date
dtComp = Nz(Me!txtCompl, 99) 'date complete
dtSusp = Nz(Me!txtsusp, 99) 'due date

If dtComp = 99 or dtComp > dtSusp Then
[txtCompl].ForeColor = vbRed
End If
 
Hi


This is very confusing when you first try to do it.

You need to use something called "Conditional Formatting". This is found
under the "Format" menu when you have your form open in design view.

Hope this helps


Graham
 
OK so you have the code to tell the field to turn red, but
where's the code to tell it to turn BACK TO white/black or
whatever? Once it turns the field red, they're ALL red
because you haven't told it to do otherwise.
 
You also have to put the code in the On Format or On Print
property of the Form/Report.
 
Back
Top