XP said:
I'm sorry, I'm having a brain blockage today; regarding FIND:
How do I open a recordset on my subform (ADO)?
Then, how do I move the record selector to that record in the subform?
I'm retrieving a value in a variable (lLink) from a field called
LINKED_RECORD like so:
lLink = Nz(Me.sfrmApprovalMain.Form![LINKED_RECORD].Value, 0)
IF lLink = 0 Then Exit Sub
I then need to move the record selector in the subform to the record where
RCD_ID = lLink
How can I do that?
You don't open a recordset on a form. Bound forms have a
recordset consisting of the records in their record source
table/query. The form's recordset is either an ADO or DAO
recordset, depending on how you have set up your database.
If you don't know what you've done in this regard, most
likely you are using DAO.
You don't move the record selector, you probably mean to
just navigate to the specified record. If you are
displaying the record selector, it will indicate which
record is current.
I think you want code like:
With Me.sfrmApprovalMain.Form
If IsNull(.LINKED_RECORD) Then Exit Sub
.Recordset.FindFirst "RCD_ID=" & .LINKED_RECORD
End With
If you get an invalid Method compile error, try using Find
instead of FindFirst.