find record on form in ADO

  • Thread starter Thread starter Keith G Hicks
  • Start date Start date
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
 
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
 
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
 
Back
Top