how to search a data in particular fields(ms access database) in vb6.0 using data1 control. I create a project in vb 6.0 using ms access data base and data control. I want to find a particular name from the data base table field. My code is....
If Data1.Recordset.Fields("C_Number") = Text15.Text Then
MsgBox "ok"
MsgBox "not" End If
But it is find first record only, how cant I find the particular data of all data in the field. Please help me.

Private Sub Command7_Click() For i = 1 To toda* If Data1.Recordset.Fields("C_Number"**) = Text15.Text(i) Then MsgBox "ok" else MsgBox "not ok" End If Next i End Sub But it is not work, not find any record even first record. no massage showing * total number of record store in the integer variable "toda" ** the table field name *** search textbox please help me


I know VB5 better than 6 but in this statement of yours

If Data1.Recordset.Fields("C_Number"**) = Text15.Text(i)

the index has got to be on recordset, surely, because you have multiple records in recordset and not in Text box ?

Hope this points you right direction

This question has already been answered. Start a new discussion instead.