mcclunyboy
Registered User.
- Local time
- Today, 07:56
- Joined
- Sep 8, 2009
- Messages
- 292
Hi,
I have a report - tried a lot of different ways, tried searching the web but I am clearly not getting something.....
I would like to turn the back colour of a rectangel red/green depending on the value of 1 of the textboxes for each record. If the value is higher than another text box then it will be red, if it is lower then it will show the rectangle as green.
I have opened the Page Load event procedure VB ...stuff....and have procceded to type the following:
This turns it red....so now I want to add an IF statement -this is where I am going wrong, Access can't find the controls - WHY...I have spelt it right - should I be using the control name (text box) or the control source name (query field)
I have tried to use conditional formatting the usual way but for some reason it doesn't colour the boxes unless you click on them - I would prefer to fix it using VB anyway.
I have a report - tried a lot of different ways, tried searching the web but I am clearly not getting something.....
I would like to turn the back colour of a rectangel red/green depending on the value of 1 of the textboxes for each record. If the value is higher than another text box then it will be red, if it is lower then it will show the rectangle as green.
I have opened the Page Load event procedure VB ...stuff....and have procceded to type the following:
Code:
Private Sub Report_Open(Cancel As Integer)
Me.rect.BackColor = vbRed
End Sub
Code:
Private Sub Report_Open(Cancel As Integer)
If Me.txt_app_scores.Value > 1000 Then
Me.rect.BackColor = vbGreen
End If
I have tried to use conditional formatting the usual way but for some reason it doesn't colour the boxes unless you click on them - I would prefer to fix it using VB anyway.