Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW TO CALL REPORT_NODATA FROM VB? 1

Status
Not open for further replies.

pelagic

Programmer
Nov 7, 2002
97
US
Hi there,
Is it possible to call Access Report_NoData() procedure
from VB Code?
For example:
I have cmdReport() when I click on this button is there a way to call Report_NoData() procedure from MS Access.

thanks,
 
Not sure I understand your question.

The no data event of the report "invokes itself" when the recordsource of the report doesn't contain any rows.

If you wan't to call a reports on no data event from another event/sub..., it's also possible, but then:

1 - the report must be open
2 - the on no data sub must be declared as public

[tt]Reports!MyReport.ReportNoData (True)[/tt]

or from within the report (then no need for public declaration of the sub)

[tt]ReportNoData (True)[/tt]

- but if the report is alredy open, other events might be better, using the cancel property within the no data, would not "prevent the opening" of the report since it's alredy open...

Roy-Vidar
 
Would the DCount function suffice?
If DCount(&quot;field&quot;,&quot;Report query&quot;)<1 then
msgbox &quot;Report contains no data&quot;
endif

Andy

Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top