Hi,
My form contains an unbound textbox named "txtFind".
User is supposed to enter a customer id number and type 'enter'.
Event behind "txtFind" is:
Private Sub txtFind_AfterUpdate()
Dim rs As ADODB.Recordset
Dim x
x = DLookup("Customer_nr", "CUSTOMERS", "Customer_nr = " & txtFind)
If IsNull(x) Then
MsgBox "Customer not in database.", vbExclamation, "Prepaid Search Engine"
Else
Set rs = Me.RecordsetClone
rs.Find "Customer_nr = " & txtFind
Do
Err.Clear
Me.Bookmark = rs.Bookmark
If Err = 0 Then Exit Do
DoEvents
Loop
End If
End Sub
When testing it, I get following error:
"Run-time error '13'
Type Mismatch"
The code gets stuck on line: "Set rs = Me.RecordsetClone"
It seems that he does not recognize rs as recordset datatype, because rs=Nothing.
Anyone has a clue?
Thanx,
Natha
My form contains an unbound textbox named "txtFind".
User is supposed to enter a customer id number and type 'enter'.
Event behind "txtFind" is:
Private Sub txtFind_AfterUpdate()
Dim rs As ADODB.Recordset
Dim x
x = DLookup("Customer_nr", "CUSTOMERS", "Customer_nr = " & txtFind)
If IsNull(x) Then
MsgBox "Customer not in database.", vbExclamation, "Prepaid Search Engine"
Else
Set rs = Me.RecordsetClone
rs.Find "Customer_nr = " & txtFind
Do
Err.Clear
Me.Bookmark = rs.Bookmark
If Err = 0 Then Exit Do
DoEvents
Loop
End If
End Sub
When testing it, I get following error:
"Run-time error '13'
Type Mismatch"
The code gets stuck on line: "Set rs = Me.RecordsetClone"
It seems that he does not recognize rs as recordset datatype, because rs=Nothing.
Anyone has a clue?
Thanx,
Natha