Link to home
Start Free TrialLog in
Avatar of Matt Chornomaz
Matt Chornomaz

asked on

Access VBA - Open a form, jump to the record found in a recordset

I'm sure this is something simple, but i can't seem to find it.  I think i'm probably using the wrong search terms.  So if this was answered elsewhere, i apologize.

Here are the steps i'm trying to take...
- I open a recordset in vba based on some conditions.  Note: there will always be multiple records returned in this recordset.
- I then find one specific record in that recordset.
- I want to then open up a form with the multiple-record recordset behind it (so user can navigate back and forth through the found records).
- Then i want the form to jump to the specific record i previously found in the code - This is the part i need help with

Note: FindFirst will always be successful (no need to check for matches).

With myRecordset
    .FindFirst "hearingdate = " & HearingDate
End With

DoCmd.OpenForm "frmHearing", acNormal

Set Forms!frmHearing.Recordset = myRecordset

-----This is the question...now that the form is open with the desired recordset-------
-----I want to jump to the specific record that was found using FindFirst----

Forms!frmHearing.Requery

Set myRecordset = Nothing
Set myDB = Nothing

Open in new window


I know this must be super simple.  But i just can't seem to locate the solution for whatever reason.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Daniel Pineault
Daniel Pineault

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Matt Chornomaz
Matt Chornomaz

ASKER

Thanks Daniel!  The first method got me on the right track.  It's working great now.
My pleasure.