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

Hilite a 0 value record in a report.

Status
Not open for further replies.

luccas

Technical User
Dec 21, 2000
30
0
0
US
I have a report where I want to activate a textboxes color when the value of another text box = 0. Example: I have a parts list when the value of [parts ordered]-[Parts recieved] = 0. I want a textbox that I have placed over the that record to hilite a color.
 
Hi:
If you use Access2000 you could use Conditional Formating on Format Menue to do the job. Actually, You can set up to three conditions for the field. Plus, you can use constants or other fields' values to write your conditions.
Also, you can play with Font & COL.

Good lock,
 
Another way is an If/Then in the Detail sections Print event. It would look something like this:

[tt]If [parts ordered]-[Parts recieved] = 0 Then
MyHiLite.BackStyle = 1
MyHiLite.BackColor = 255
Else
MyHiLite.BackStyle = 0
MyHiLite.BackColor = 16777215
End If[/tt]

Then you'd have a textbox named MyHiLite which would flip between Red and Transparent based on the calculation. One other thing, rather than performing the Ordered-Received calculation like I did in the code, put the name of the textbox where you already did the calculation so you're not performing the calc again. Like so:

[tt]If CalcTextBox = 0 Then[/tt]

HTH
Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top