Return to current record after Requery

  • Thread starter Thread starter Macsmasher
  • Start date Start date
M

Macsmasher

Running Access 07.

I have frmOpportunityDetails, from which I launch frmQuotes. frmQuotes is
based on a related tbl linked by the key field OpportunityID.

The following works from cmdClose on frmQuotes "provided" the recordset on
frmOpportunityDetails is unfiltered:

With Forms!frmOpportunityDetails
Dim intCurrent As Integer
intCurrent = .OpportunityID
.Requery
.Recordset.FindFirst "OpportunityID = " & intCurrent
End With

However, if frmOpportunityDetails is filtered, the above doesn't work. The
recordset is Requeried, but then I'm left at the first record in the
RecordSet.

What am I missing??

Thanks in advance,
Larry
 
I got it. This works great:

With Forms!frmOpportunityDetails
Dim intCurrent As Integer
intCurrent = .OpportunityID
.Filter = ""
.FilterOn = False
.Requery
.Recordset.FindFirst "OpportunityID = " & intCurrent
End With

-Larry
 
Back
Top