Error 0??

01-09-2004, 11: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?


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

01-09-2004, 11: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
Me.Text1.Text = strSQL

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

Set cn = Nothing
Unload Me
End Select

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

End Sub

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

Exit Sub

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