Return to record on main form

J

Judy Ward

Man, here it is 5pm on a Friday and I'm stuck!

Here's my problem. I click a button on one form, frmIntegration, to launch
a 2nd form, frmUse_Case. After I'm done editing and close frmUse_Case I want
to do two things: requery frmIntegration (which I know how to do) AND return
to the record that I was on when I left the form (which I don't know how to
do). I am opening the 2nd form by sending an argument (stIntegration), so it
does know what record it wants to return to--I just don't know how. The form
is already open, so I don't need to reopen it.

HELP!

Thank you,
Judy
 
T

Tom van Stiphout

On Fri, 5 Dec 2008 17:14:00 -0800, Judy Ward

in frmUseCase_Close write (untested):
dim lngIntegrationID as long
with forms!frmIntegration
lngIntegrationID = !IntegrationID 'Save the PK.
..Requery
dim rs as DAO.Recordset
set rs = .RecordsetClone
rs.FindFirst "IntegrationID=" & lngIntegrationID
if rs.NoMatch then
MsgBox "This CAN'T be happening to me! It was there a second ago!"
else
.Bookmark = rs.Bookmark
end if
end with
'TODO: Cleanup of objects.

-Tom.
Microsoft Access MVP
 

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