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

Help on Conditional Formating

Status
Not open for further replies.

jen1701

Programmer
Dec 20, 2003
57
US
I have some problem to make the conditinal formating working the way I wanted. I have 2 fields on a subform: [SsheduledHours] and [ActualTime]. If the [ActualTime]< [SsheduledHours], forecolor of [ActualTime] is red otherwise is black. I added the condition on the form under Format. But [ActualTime] font color is always red, even [ActualTime]>[SsheduledHours]. Please advise what should I do to make it work. I am stuck with it. Thank you very much for your help in advance.

Jen
 
If it's possible to have some event trigger it, I would code it in a module:

If [ActualTime]>[SsheduledHours] Then
fieldname.forecolor = 0
Else
fieldname.forecolor = (number for red)
End If

Good luck.
 
Hi Laurie,

Thanks for the reply. I tried that as well. I have afterupdate even on the EmpNo field which load the ActualTime. But it did not work either. I wonder where is the problem. Is anyone can shine some lights on it?

Thanks,

Jen
 
Programmatic attempts to do conditional formatting on continuous forms are very difficult (if possible at all). Usage of the conditional formatting however usually works. Is this a continuous form? By the reference to "subform" I'm kind of assuming it.

Not sure why you aren't able to make it work, but some thoughts:

* are the values of the controls/fields comparable (both being same datatype; dates, integers, strings...). By the name of them, I'd assume they where different datatypes
* when typing field/control names into the conditional formatting, you need to be completely sure they are correctly typed (seldom or never any errormsg, only "faulty formatting") (use copy paste of the names;-))
* have you tried using the "Expression is" from the first dropdown, then entering the expression in the box at right:

[tt][ActualTime]>[SsheduledHours][/tt]

To be of more assistance, perhaps post the names of the fields/controls, the datatype, and some sample values of both.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top