I am using find command in vb6 using to conditional statement.

Call dbconek
With ar
.Open "Select *From numgroup", strconek, adOpenStatic, adLockOptimistic
.Find "numero = '" + bet + "' And "draw_date = " & DateValue(vdrawdate.Text) & "", 0, adSearchForward
If Not .EOF Then
msgbox "record is existing"
msgbox "record is not existing"
End If
End With

I received error from .find command "Type mismatch Error 1"

my datafield
numero -----> string
draw_date -----> short date

my variables
bet ------------> string
vdrawdate.text --------> as textbox

the error comes from draw_date and vdrawdate.

anybody can help me or there is any other solution.

thank in advance

Why not simply use the WHERE clause along with the SQL statement to find the record. You can also use COUNT to find if the record exists and then display the message accordingly. Using COUNT will be really fast.


I Guess, if it is an ADO recordset, you can give Just One Column Search, (not multiple).
Like Debasis said, open another Recordset with "Where" Condition