Return to current record after Requery

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
 
M

Macsmasher

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
 

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

Top