By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,365 Members | 3,095 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,365 IT Pros & Developers. It's quick & easy.

How to use a custom error message instead of Error#

P: n/a
I have a report that I run which consists of two subreports.
Occasionally, one or the other reports do not have valid recordsets due
to a parameter query based on date.

Right now, if there are no records that match that date, I get the
generic "Error#" message. I want the report to go ahead and print even
if there are no records. Is there any way to have the "error#" message
read "No loads for today" intead?

Report Name: rptOutboundAlex-ByDate
Fields queried on the report: ShipDate, DestinationID, VendorPO,
ProductTypes, ProductForm, Carrier, CarrierPO, Notes

Thanks,
Carla

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hers2keep wrote:
I have a report that I run which consists of two subreports.
Occasionally, one or the other reports do not have valid recordsets due
to a parameter query based on date.

Right now, if there are no records that match that date, I get the
generic "Error#" message. I want the report to go ahead and print even
if there are no records. Is there any way to have the "error#" message
read "No loads for today" intead?

Report Name: rptOutboundAlex-ByDate
Fields queried on the report: ShipDate, DestinationID, VendorPO,
ProductTypes, ProductForm, Carrier, CarrierPO, Notes


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

In the report's module, in the section that holds the subreport, check
if the subreport has data. If not, hide the subreport. Underneath the
subreport put a label with a .Caption property of "No loads for today."

Example (the subreport is in the Detail section):

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

subReportName.Visible = (subReportName.Report.HasData = True)

End Sub

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQiywVYechKqOuFEgEQJybwCfVQGmdmr/ch5pNurlZFAvNknMhl4AnRNP
kw+YC+xZJJbqB6rL+SGLGp2E
=jxsG
-----END PGP SIGNATURE-----
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.