Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search For database object

Status
Not open for further replies.

vicky666

Programmer
Feb 13, 2003
22
0
0
GB
If I enter a memberid into a text box I need to be able to see if it exists in an access database. Basically a comparison string cheers
 
Try something like this to get you started, this method will move the recordset to the entered memberid, if it doesn't exist then it will tell you:

This assumes that you named your data connection Data1 and the fld name being searched is named memberid


With Data1.Recordset
varBookmark = .Bookmark
.Index = "memberid"
.Seek "=", Text1.Text
If .NoMatch Then
.Bookmark = varBookmark
End If
End With
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
-- Rich Cook.

teklogo.gif

 
if thats confusing then use this:
sql="select from table where memberid='"+text1.text+"'"
recordset.open sql,connection
if recordset.eof and recordset.bof then
msgbox "Id not found."
else
'do code here for the id.
end if Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top