V
Virage
It has been driving me mad too, but now there is a very nice way to
get around it.
1. You may get the "#error" instead of 0 or nothing, when you have
calculated fields on the report such as:
=sum(salary)
=count(months)
2. This is cuased by the fact that your recordset may not be returning
any data and thus there is no way Access can tell what to do the
caluclation on.
3. Foreget it about usign IIF: it won't work as Access does not know
how to evaluate the value of the field is does not understand:
iif(isNull or somefield <> "" etc. will not work.
4. To get around it, cancel the report display when there is no data:
Access has an event attached to the report called On No Data. You can
cancel this report when there is no data or even display a nice
message before you cancel it: try this:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "Report returned no data.", vbInformation, "ATD - Reports"
Cancel = True
End Sub
------------------------
Bartosh Michalik
Senior IT Consultant
PRISM Inc.
Victoria BC
Web: http://www.prism-itc.com
"Development of database, e-commerce and Web solutions for today's
market and today's budget!"
get around it.
1. You may get the "#error" instead of 0 or nothing, when you have
calculated fields on the report such as:
=sum(salary)
=count(months)
2. This is cuased by the fact that your recordset may not be returning
any data and thus there is no way Access can tell what to do the
caluclation on.
3. Foreget it about usign IIF: it won't work as Access does not know
how to evaluate the value of the field is does not understand:
iif(isNull or somefield <> "" etc. will not work.
4. To get around it, cancel the report display when there is no data:
Access has an event attached to the report called On No Data. You can
cancel this report when there is no data or even display a nice
message before you cancel it: try this:
Private Sub Report_NoData(Cancel As Integer)
MsgBox "Report returned no data.", vbInformation, "ATD - Reports"
Cancel = True
End Sub
------------------------
Bartosh Michalik
Senior IT Consultant
PRISM Inc.
Victoria BC
Web: http://www.prism-itc.com
"Development of database, e-commerce and Web solutions for today's
market and today's budget!"