I have created a report which derives its values from a query which is supplied with criteria from two combo boxes on a form. In an effort to make records easy to view I set up a text box in the detail section in accordance with a tip I got from the Internet.
The text box is in the detail and the Control setting is =1
The running sum property is set to Overall and View / code was selected and the following inserted.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If [RunSum] Mod 2 = 1 Then
Me.Section(0).BackColor = 15852071
Else
Me.Section(0).BackColor = 8118583
End If
End Sub
The system works well giving an easy to read report.
The problem occurs when a combination of Critera are chosen for which there is no data.
I get the message Runtime error 2427
The expression may refer to an object that has no value such as form report etc.
The user has the choice to debug or end .
Is there something I can do which will result in the form still displaying with no data or with a message "no data" or similar.
I'm using Win95, Access 97.
Any help would be greatly appreciated. Cheers,
The text box is in the detail and the Control setting is =1
The running sum property is set to Overall and View / code was selected and the following inserted.
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If [RunSum] Mod 2 = 1 Then
Me.Section(0).BackColor = 15852071
Else
Me.Section(0).BackColor = 8118583
End If
End Sub
The system works well giving an easy to read report.
The problem occurs when a combination of Critera are chosen for which there is no data.
I get the message Runtime error 2427
The expression may refer to an object that has no value such as form report etc.
The user has the choice to debug or end .
Is there something I can do which will result in the form still displaying with no data or with a message "no data" or similar.
I'm using Win95, Access 97.
Any help would be greatly appreciated. Cheers,