Dynamically formatting reports

S

Sue

Hi,

I am trying to shade an entire row in my detail section
of my report if one of the controls is null/empty (the
control is named 'typeOfSpace'). The code I came up with
is below. I get a run-time error that reads "Object
Required" and I am not understanding why I need an object
to do this. Any thoughts are greatly appreciated.

Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)
If typeOfSpace Is Null Then
Me.Detail.BackColor = 65280
Else
Me.Detail.BackColor = 8454016
End If
End Sub
 
F

fredg

Hi,

I am trying to shade an entire row in my detail section
of my report if one of the controls is null/empty (the
control is named 'typeOfSpace'). The code I came up with
is below. I get a run-time error that reads "Object
Required" and I am not understanding why I need an object
to do this. Any thoughts are greatly appreciated.

Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)
If typeOfSpace Is Null Then
Me.Detail.BackColor = 65280
Else
Me.Detail.BackColor = 8454016
End If
End Sub

There is a control named [typeOfSpace] in the report Detail Section?

If IsNull([typeOfSpace]) Then
Me.Section(0).BackColor = 65280
Else
Me.Section(0).BackColor = 8454016
End If
 
G

Guest

Thank you Fred, that worked!

-Sue
-----Original Message-----
Hi,

I am trying to shade an entire row in my detail section
of my report if one of the controls is null/empty (the
control is named 'typeOfSpace'). The code I came up with
is below. I get a run-time error that reads "Object
Required" and I am not understanding why I need an object
to do this. Any thoughts are greatly appreciated.

Private Sub Detail_Format(Cancel As Integer, FormatCount
As Integer)
If typeOfSpace Is Null Then
Me.Detail.BackColor = 65280
Else
Me.Detail.BackColor = 8454016
End If
End Sub

There is a control named [typeOfSpace] in the report Detail Section?

If IsNull([typeOfSpace]) Then
Me.Section(0).BackColor = 65280
Else
Me.Section(0).BackColor = 8454016
End If
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
.
 

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

Top