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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

search

Status
Not open for further replies.

knaya

MIS
Dec 4, 2003
51
US
and i thought i knew access..NOTTT... so i'm stuck again, all i want to do is have a user enter an i.d, click on a search button and this should diplay the remaining info associated with this i.d (all from one single table).. Ho someone helpp.. Thanks
 
Try this:
Dim rs As Recordset
Dim bkm As String
Set rs = Me.RecordsetClone
rs.MoveFirst
rs.FindFirst ("[ID]=" & Me.id)
bkm = rs.Bookmark
rs.Close
Me.Bookmark = bkm

it's untested, but should give you the way. :)

MakeItSo

Andreas Galambos
EDP / Technical Support Specialist
(andreas.galambos@bowneglobal.de)
HP:
 
archhhhh, i cant get it to work.. its on a form and nothings happening when i enter the i.d and hit the search button.. thanks Andreas for trying to help...any other solution..anyone...helpppppppppp.
 
Hi knaya,

That was my fault: I inserted Me.ID as criterion, but the field is certainly named differently:
It's the name of your search-ID-textbox that goes there.
e.g. I have named my textbox where I enter the ID "SrchID". Then the (tested and running!:)) code will be:

Dim rs As Recordset
Dim bkm As String
Set rs = Me.RecordsetClone
rs.MoveFirst
rs.FindFirst ("[ID]=" & Me.SrchID)
bkm = rs.Bookmark
rs.Close
Me.Bookmark = bkm

[red]Beware:If your ID is a string, e.g. 10/123/447 (with other than numeric chars), you must enclose the SrchID with single quotes:
rs.FindFirst ("[ID]='" & Me.SrchID & "'")
[/red]
Replace the SrchID with the name of your textbox and voilà!
[pipe]

Good luck,
Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top