backcolor

B

Brian

can anyone tell me what is wrong with this code. I have something
similar but using the IsNull and it works fine but this does not


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me!Pay = " '&OVER&'" Then
Me!Pay.BackColor = 12632256
Else
Me!Pay.BackColor = 16777215
End If
End Sub
 
D

David Roseberry II

Brian said:
can anyone tell me what is wrong with this code. I have something
similar but using the IsNull and it works fine but this does not


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me!Pay = " '&OVER&'" Then
Me!Pay.BackColor = 12632256
Else
Me!Pay.BackColor = 16777215
End If
End Sub

Try changing "!" to "."

If Me.Pay = " '&OVER&'" Then
Me.Pay.BackColor = 12632256
Else
Me.Pay.BackColor = 16777215
End If
 
B

Brian

no such luck. I step through it in code and looks fine but when the
report comes out in preview mode nadda
 
F

fredg

can anyone tell me what is wrong with this code. I have something
similar but using the IsNull and it works fine but this does not

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me!Pay = " '&OVER&'" Then
Me!Pay.BackColor = 12632256
Else
Me!Pay.BackColor = 16777215
End If
End Sub
This line > If Me!Pay = " '&OVER&'" Then <
is certainly incorrect, but it is not clear from this message what
would be correct.

What is &OVER& ?

Is that an ACTUAL value (including the &'s) that can be stored in the
field [Pay]?
If Me!Pay = '&OVER&' Then

Otherwise please explain what &OVER& represents.
 
M

Marshall Barton

Brian said:
can anyone tell me what is wrong with this code. I have something
similar but using the IsNull and it works fine but this does not


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me!Pay = " '&OVER&'" Then
Me!Pay.BackColor = 12632256
Else
Me!Pay.BackColor = 16777215
End If
End Sub


Are you sure the value of Pay includes the one space,
apostrophes and ampersand characters?
 
T

tina

well, i'm guessing that OVER is a hard text value, not a variable in the
module or a control in the form. if that's correct, try

If Me!Pay = "OVER" Then

hth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Formatting Detail Backcolor 2
Please help! 1
Display line when... 4
Report error Run Time error 2427 1
Format Question 1
font 1
on format event procedure to back color a line of text 11
Main Report without Data 1

Top