-
I am presently accessing an Access DB using DAO. With the recordset open I would like to search through the already open recordset, choose a record, and fill my text boxes with the associated information from the rs. What would be the easiest way to do this. This is how I am trying to do it now:
SearchStr$ = Search.Text
rs.Index = CompName
rs.Seek "=", SearchStr$
If rs.NoMatch Then
MsgBox "No match note", vbInformation
End If
Obviously this will not fill the associated text boxes but I cannot get it to search the recordset at all. I have the DB indexed on the CompName column in the table. Always get a run time error 3251.
ANY HELP WOULD BE GREATLY APPRECIATED!
-
Hai,
Better see the help for Criteria in MSDN HELP.
I did it last time to search a record . if it is there it will display in text boxes, other wise it will give the message.
I was using datacontrol for this.
If you are using recordset then just map the text box with the respective recordset fields.
It will work.
------------------
With regards,
Karun
-
-
That did it. I sware I tried before and could not get it working, oh well. Here is a snap shot of the code for anyone else who may be having the same problem:
findstring = "CompName = '"& Search.Text& "'"
rs.FindFirst findstring
If rs.NoMatch Then
MsgBox ("User does not exist")
Else
MsgBox ("User does exist!")
End If