|
-
Feb 9th, 2000, 10:22 AM
#1
Thread Starter
Lively Member
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!
-
Feb 9th, 2000, 11:05 AM
#2
Member
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
-
Feb 9th, 2000, 02:15 PM
#3
Guru
-
Feb 9th, 2000, 08:15 PM
#4
Thread Starter
Lively Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|