Stay with Current Record

T

Tee See

Here we go again ......

Currently have a form "frmMainform" with subform "frmSubForm" where/when
there is no data in the subform I CLICK on a button to invoke a
"frmPopUpForm" to add info to the subform table which is bound. After close,
the requery statement takes place and requeries but returns the
"frmMainForm" and the related "frmSubform" to the first record of the
"frmMainForm".
How do I stay with the same record I was viewing when I invoked the
"frmPopUpForm"?

Regards
 
J

John Spencer

Store the primary key of the current record
Then do the requery
Then find the record that has the primary key.

Something like the following UNTESTED AIRCODE.

Dim lngPK as Long

lngPK = Me.PrimaryKey

Me.Requery

With Me.RecordsetClone
.FindFirst "PrimaryKey = " & lngPk
if .NoMatch = False then
Me.BookMark = .Bookmark
End if
end With
 

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