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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error trap runtime error 6: Overflow 1

Status
Not open for further replies.

weezles

Technical User
Jul 18, 2003
81
GB
hi

I am getting a runtime error 6 when I try to run a report. Then in the status bar say its formatting page and press ctl+break to break, this however doesn't work.

How do I find out where the problem and enter error handling to prevent it from happening again?

Ta

Lou
 
The overflow error usually indicates that an integer variable has exceeded 32,767. The following code for the OnClick event of a button will cause this error. You can set a breakpoint on the Resume line. When the error occurs you can examine the value of your variables to determine which value is exceeding 32767.

Code:
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click

    Dim I As Integer
    
    I = 32000
    
    Do
        I = I + 1
    Loop

Exit_Command0_Click:
    Exit Sub

Err_Command0_Click:
    MsgBox Err.Number & "  " & Err.Description
    Resume Exit_Command0_Click
    
End Sub
 
I agree with mndrlion as integers being the most common cause of this issue. If you identify that this is the problem, change your integers to long.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top