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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change a field colour on continuous forms

Status
Not open for further replies.

Muzzy

Programmer
Dec 14, 2001
68
GB
Hi All,

I have a continuous form which obviously displays more than one record. There are two date fileds, target date and date today. If the date today is greater than the target date I want the field to turn red instead on being white. the problem is that when this condition is met it changes the field for all records and not just the ones which evaluate to true. Any ideas on how to get this to work?

Cheers

Muzzy
 
Try this,
in the subform design view, right click on the datetoday field. go to the afterupdate field and type the following.

if todaysdate > targetdate then
targetdate.forecolor = vbred
else
targetdate.forecolor = vbwhite
end if

** you can also use the conditional formatting option to do the same thing. Just right click on targetdate, hit conditional formatting and then put in todaysdate>targetdate as the criterea. Hope this helps. Later.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top