find record on form in ADO


K

Keith G Hicks

I'm drawing a blank here. I know how to do this with mdb's and DAO as
follows:

Me.RecordsetClone.FindFirst "ID = " & someIDpassed
Me.Bookmark = Me.RecordsetClone.Bookmark

but how to do this with ADO and ADP's?

Thanks,

Keith
 
Ad

Advertisements

K

Keith G Hicks

Never mind. Figured it out:

Dim rs As adodb.Recordset
Set rs = Me.frmAdjLetterSched_Subform.Form.Recordset.Clone
rs.Find "SchedDesc = '" & Replace(sNewAdjSchedDesc, "'", "''") & "'"
Me.frmAdjLetterSched_Subform.Form.Bookmark = rs.Bookmark
 
Ad

Advertisements

T

Tom van Stiphout

After the 3rd line you can add this code, because per best practices
you should not expect Find to always find the record:
if rs.eof then
Msgbox "Arrcchhh, not found!"
else

-Tom.
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top