PDA

View Full Version : help find criteria by useing text field



malkasoft10
03-21-2007, 06:44 AM
Hi brothers
i have acc table with following field

acc_no text
acc_name text
balance number

Dim bab As DAO.Recordset
Set db = CurrentDb
Set bab = db.OpenRecordset("acc", dbOpenDynaset)
Dim strCriteria As string
strCriteria = "[acc_no] =" & Me.Acc_no1
bab.FindFirst (strCriteria)
If Not bab.NoMatch Then
bab.addnew
etc...

I use this code to find criteria and I got this message error
Run-time error '3464': Data type mismatch in criteria expression
in bab."FindFirst (strCriteria)" line
I know why this message its because use of text field in the acc table
But my project need text field rather than number field

So how can I using find first with text field

thanks

akn112
03-21-2007, 07:42 AM
would implementing the format() function on strCriteria fix the problem?

malkasoft10
03-22-2007, 04:00 AM
would implementing the format() function on strCriteria fix
the problem?

THANKS MAN ITS OK