Re: Blank Report (Almost There)
- From: DS <bootybox@xxxxxxxxxxxxx>
- Date: Thu, 04 Aug 2005 16:22:47 -0400
DS wrote:
OK, I have this, it kills the 2501 message, the problem is that it only works with one report. If I add a second report, well if the first report has no info and the second does, it closes everything. How do you use this 2501 erroe trap with multiple report printouts?DS wrote:
Dan wrote:
I tried putting this on the "No Data" event of the Report...You would put some code in the "On No Data" event to close the current report and open the next. DS
"DS" <bootybox@xxxxxxxxxxxxx> wrote in message news:ifsIe.25116$Kx6.16345@xxxxxxxxxxx
If you have a group of Reports strung together to Print and one of the reports in the series doesn't have any info how do you get it not to print and just go to the next report with info? Thanks DS
DoCmd.Close acreport, "rptBar"
It said that this command was unavalable....so I tried
DoCmd.CancelEvent
This gave me a Messagebox "This has been cancelled" which didn't open the report but it also interrupted my code to close the form from which I'm calling this from.
Private Sub Command148_Click()
On Error GoTo Err_Command148_Click
DoCmd.OpenReport "rptKitchenHot", acViewPreview, , "[SalesID] = " & Me.SalesID
DoCmd.OpenReport "rptBar", acViewPreview, , "[SalesID] = " & Me.SalesID
DoCmd.Close acForm, "Sales"
Exit_Command148_Click:
Exit Sub
Err_Command148_Click: MsgBox Err.Description Resume Exit_Command148_Click
End Sub
Thanks DS
I have this and it almost works except I can't get the error message from poping up.
Private Sub Report_NoData(Cancel As Integer) Cancel = True DoCmd.Close acForm, "Sales" Response = acDataErrContinue End Sub
Thanks DS
Thanks
DS
Private Sub cmdReport_Click()
On Error GoTo Err_Handler
DoCmd.OpenReport "rptBar", acViewPreview, , "[SalesID] = " & Me.SalesID
DoCmd.OpenReport "rptKitchenHot", acViewPreview, , "[SalesID] = " & Me.SalesID
DoCmd.Close acform,"Sales"
Exit_Handler: Exit Sub
Err_Handler:
Select Case Err.Number
Case 2501
Case Else MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number
End Select
Resume Exit_Handler
End Sub .
- Follow-Ups:
- Re: Blank Report ANSWER FOUND
- From: DS
- Re: Blank Report ANSWER FOUND
- References:
- Blank Report
- From: DS
- Re: Blank Report
- From: Dan
- Re: Blank Report
- From: DS
- Re: Blank Report (Almost There)
- From: DS
- Blank Report
- Prev by Date: Microsoft Web Browser - Can you resize this in a form?
- Next by Date: RE: how do i get my command button to work?
- Previous by thread: Re: Blank Report (Almost There)
- Next by thread: Re: Blank Report ANSWER FOUND
- Index(es):