View Full Version : Run-time error '3001', this isn't Sparta


Salient
08-23-2007, 04:49 PM
vb6 connecting via ADO to a DNS reference to a MS Access 2003 database


Private Sub cboCategory_Click()
'
With pobjADOtable
.MoveFirst
.Find ("CategoryName=" & cboCategory.Text)
If .EOF Then
MsgText = "Error on Database Table" & vbCrLf _
& "Trying Screaming for help
MsgBox MsgText, vbExclamation, MsgHeader
Exit Sub
Else
LoadText
End If
End With
'
End Sub


Am getting the error on the .find clause


Arguements are of the wrong type, are piut of acceptance range, or are in conflict with one another


:( Anyone know what MS are trying to tell me there :confused:

RuralGuy
08-23-2007, 05:22 PM
Try this code:
Private Sub cboCategory_Click()
'
With pobjADOtable
.MoveFirst
' .Find ("CategoryName=" & cboCategory.Text)
.Find ("CategoryName='" & cboCategory.Text & "'")
If .EOF Then
MsgText = "Error on Database Table" & vbCrLf _
& "Trying Screaming for help"
MsgBox MsgText, vbExclamation, MsgHeader
Exit Sub
Else
LoadText
End If
End With
'
End Sub

Salient
08-23-2007, 07:27 PM
Thanks RG, it's now working like a brought one :)

Actually haven't touched vb for five or so years, and am well out of touch with it at the moment. Might help if I wasn't currently coding in three separate languages :(

RuralGuy
08-23-2007, 07:38 PM
Glad I could help.