nodata on reports

J

jnewl

i am generating snapshot reports via access vb. i have a nodata routine in
the reports, so that a msgbox appears when there is no data.

i am using the following code to generate the snapshot reports. how do i
check for nodata, so that i do not execute the docmd. output statement

If Forms![select ancillary group]![report category] = 2 Then
DoCmd.OpenQuery "qry select not passed records for report"
If Forms![select ancillary group]![group var] = "facility" Then
stDocName = "facility not passed"

DoCmd.OutputTo acOutputReport, "facility not passed", "snapshot
format", _
"g:\fee sched test\" & monthlitl & category & " not passed", True

thanks for your help
 
J

jnewl

i already have a section in the reports for no data, that is how i get the
msgbox when have no data

what i need to know is how do i check for that in code provided, so that i
do not execute the docmd statement that is in the code provided
 
D

David H

Once the report is opened, you should be able to check the record count of
the report's record source as in

[Reports]![myReport].RecordSet.RecordCount

You may have to play with the syntax a bit as its been awhile since I've
worked with Access, but that's were I'd start. Just keep the report open
otherwise you won't have access to the property. You may want to open it as
hidden.

jnewl said:
i already have a section in the reports for no data, that is how i get the
msgbox when have no data

what i need to know is how do i check for that in code provided, so that i
do not execute the docmd statement that is in the code provided

jnewl said:
i am generating snapshot reports via access vb. i have a nodata routine in
the reports, so that a msgbox appears when there is no data.

i am using the following code to generate the snapshot reports. how do i
check for nodata, so that i do not execute the docmd. output statement

If Forms![select ancillary group]![report category] = 2 Then
DoCmd.OpenQuery "qry select not passed records for report"
If Forms![select ancillary group]![group var] = "facility" Then
stDocName = "facility not passed"

DoCmd.OutputTo acOutputReport, "facility not passed", "snapshot
format", _
"g:\fee sched test\" & monthlitl & category & " not passed", True

thanks for your help
 

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