Error 0??

giana
01-09-2004, 10:06 AM
Hi, I have a data report in vb6. The report is running fine and it shows all I need, but everytime I run it I get a message of "Error 0". I click on ok and I can see and print the report without problems. Anybody knows what that is and how to get rid of it?

thanks
giana

reboot
01-09-2004, 10:30 AM
Not without seeing your code.

giana
01-09-2004, 10:34 AM
ok, here it is:


Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
On Error GoTo ErrTrap:
Select Case Button.Index Case 1 '---------report--------
On Error GoTo Handler:

Dim strSQL As String
Dim strDateIn As String
Dim strDateOut As String

strDateIn = Me.DTPicker1.VALUE
strDateOut = Me.DTPicker2.VALUE

strSQL = "SELECT Name_Last, Name_First, GroupName, Date_In, Housing_Unit, Date_Out FROM CONTACTS" & _
" WHERE Date_In BETWEEN #" & strDateIn & "# AND #" & strDateOut & "# AND Date_Out BETWEEN #" & strDateIn & "# AND #" & strDateOut & "#"

Call RecQuery(strSQL, Rs)
Set DateHousReport.DataSource = Rs
DateHousReport.Show
Me.Text1.Text = strSQL

Handler:
MsgBox "Error: " & Err.Number & " " & Err.Description, vbCritical, "Error" Case 3 '-------cancel--------

Set cn = Nothing
Unload Me
End Select

ErrTrap:
Select Case Err.Number
Case 0
Resume Next
Case Else
MsgBox "Error: " & Err.Description & Err.Number, vbCritical, "Error"
End Select

End Sub

reboot
01-09-2004, 10:37 AM
Set cn = Nothing
Unload Me
End Select

Exit Sub

ErrTrap:
Select Case Err.Number It's simply falling through, and since there's no error, the number is 0.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum