Overflow Error "6" when using OutputTo rtf

mattkorguk

Registered User.
Local time
Today, 02:31
Joined
Jun 26, 2007
Messages
301
Hi,
I have tried searching here and found no solution to this little issue.

The Overflow error occurs when using the following code;
Code:
DoCmd.OutputTo acOutputReport, Me.SelBP.Value & " Summary Report", acFormatRTF, "C:\BPD\" & Me.SelBP.Value & " Summary Report.rtf"

You can see the report going through and when it reaches 5 or 6 pages, I receive the Overflow error.
If it's a short report all is well and it works fine.

Any suggestions please.
 
"Overflow" is generally a result of trying to multiply zero times zero or trying to divide zero into zero.
Access can't do this.
Go back to the query that runs the report and run the query on its own. See if you get an "Overflow" error. If so, you will have to use the IIF condition to get around it.
 
Thanks for your reply. I have searched prior to posting and found many references to calculations being the issue, but that would mean surely that this happened on all reports and not just the longer ones?!
The report runs fine if you just preview it, but even in preview when you try and view in Microsoft Word you receive the same Runtime Error 6 and again, only if the report is 5+ pages long. There must be something that happens during this process...?
 
I have broken down the report and removed a section which is actually an additional subreport which has further subreports! And now it's working ok, so I shall be looking if that can be broken down or just moved into another, seperate report when exporting to Word.
 
OK, this is what I went for in the end...

Code:
Private Sub cmdWord_Click()
If IsNull([SelBP]) Then GoTo NoBP:
On Error GoTo cmdEmail_Err
DoCmd.SetWarnings False
    DoCmd.CopyObject , Me.SelBP.Value & " Summary Report", acReport, "rptBP-LeadSheetWord"
    DoCmd.CopyObject , Me.SelBP.Value & " Multis Report", acReport, "rptBP-MultisWord"
    DoCmd.OutputTo acOutputReport, Me.SelBP & " Summary Report", acFormatRTF, "C:\BPD\" & Me.SelBP & " Summary Report.rtf"
    DoCmd.OutputTo acOutputReport, Me.SelBP & " Multis Report", acFormatRTF, "C:\BPD\" & Me.SelBP & " Multis Report.rtf"
 
    Call ZipFile_FX("C:\BPD\" & Me.SelBP.Value & " Summary Report.zip", _
    "C:\BPD\" & Me.SelBP.Value & " Summary Report.rtf")
    Call ZipFile_FX("C:\BPD\" & Me.SelBP.Value & " Summary Report.zip", _
    "C:\BPD\" & Me.SelBP.Value & " Multis Report.rtf")
 
    If MsgBox("A Zip folder has been created called (" & Me.SelBP.Value & " Summary Report" & ".zip)" & Chr(13) & Chr(10) _
    & "Located in your C:\BPD folder." & Chr(13) & Chr(10) & "PLEASE REMEMBER TO ENCRYPT BEFORE SENDING", vbExclamation + _
    vbOKOnly, "ZIPPED") = vbOK Then
 
    Call Shell("""c:\program files\winzip\winzip32.exe""" & " " & """C:\BPD\" & Me.SelBP.Value & " Summary Report.zip""", vbMaximizedFocus)
    SendKeys "%(AY)"    'open password prompt dialogue
 
    End If
DoCmd.SetWarnings True
Exit Sub
cmdEmail_Err:
    MsgBox "You cancelled and did not send the email", vbExclamation
    DoCmd.DeleteObject acReport, Me.SelBP.Value & " Summary Report"
    DoCmd.DeleteObject acReport, Me.SelBP.Value & " Multis Report"
Exit Sub
 
NoBP:
    MsgBox "Please select a Business Partner from the drop-down list.", vbOKOnly, "Select BP"
    Me.SelBP.SetFocus
    Me.SelBP.Dropdown
End Sub

Plus...

Code:
Private Sub ZipFile_FX(ZipFileName As String, fileToBeZipped As String)
Const ZIPEXELOCATION = "c:\program files\winzip\winzip32.exe"
Shell ZIPEXELOCATION & " -a " & Chr(34) & ZipFileName & Chr(34) & " " & Chr(34) & fileToBeZipped & Chr(34), vbHide
End Sub

Hopefully that might help others, you never know. :D
 
"Overflow" is generally a result of trying to multiply zero times zero or trying to divide zero into zero.
Access can't do this...
Dividing anything by zero is always a problem - in Access and in the real world, but multiplying zero by anything, including another zero, should not cause a problem, unless the result (zero) is subsequently used somewhere that zero is out of bounds.
 
Hi,

I had a similar problem. It just said "Overflow error". When I looked at one of the sub-reports I found a field right over on the right hand side. I brought it back to the left and the problem went away. It had always worked before So why did it suddenly start giving an error?

I hope this helps
 

Users who are viewing this thread

Back
Top Bottom