Rabu, 24 April 2013

RE: [MS_AccessPros] Do

 

Jim,

How are you checking for data and canceling? 

Duane Hookom MVP
MS Access

----------------------------------------
> From: luvmymelody@yahoo.com
>
> John
> There was no code in the ON No Data event. So I added the code to cancel the report based on Duane's suggestions and I still get an error
>
> Jim Wagner
> ________________________________
>
>
>
> ________________________________
> From: John Viescas <JohnV@msn.com>
>
> Jim-
>
> The most common cause of this sort of error is a Cancel in the report's No
> Data event procedure. If your filter results in no records, the On No Data
> event will fire, and if you have a Cancel in that, then that generates the
> 2501. I recommend adding an error trap in your code to ignore the 2501.
>
> John Viescas, Author
>
> -----Original Message-----
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Duane Hookom
>
> Jim,
>
> I expect the issue might be no records in rpt_33NewHires that match the
> where condition. Then your report probably has an issue or closes on no
> records and causes the error in the calling form.
>
> I would check to see if the report's record source combined with the where
> condition would return any records prior to attempting to open it.
>
> Duane Hookom MVP
> MS Access
>
> ----------------------------------------
> > From: luvmymelody@yahoo.com
> >
> > I have this function that outputs a report as pdf to a folder location on
> the network and the process stops on the the outputto line of code. I get a
> run time error of 2501. The OutputTo action was canceled. When I hover over
> the docmd.outputto in the highlighted line I see acOutput=3 which I am not
> sure what that is. Below is part of the code and the last line is what is
> highlighted. I have a feeling that it is the select statement that is
> causing the issue. Is there a line in the select statement that I am
> missing?
> >
> > Thank You
> >
> > Jim Wagner
> >
> > DoCmd.OpenReport "rpt_33NewHires", acViewPreview, _
> > WhereCondition:="[Dept Id] IN (SELECT Department " & _ "FROM
> > [tblPollyDepartments])"
> > DoCmd.OutputTo acOutputReport, "rpt_33NewHires", "PDFFormat(*.pdf)",
> > "\\Afwfs\AF\Services\UnivSrv\Admin Services\DATA MANAGEMENT
> > SERVICES\Master PeopleSoft Tables\Repurpose Database\Department
> > Reports\rpt_33FACMANNewHires.pdf", False, "", , acExportQualityPrint

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (5)
Recent Activity:
MARKETPLACE


.

__,_._,___

Tidak ada komentar:

Posting Komentar