Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Return to record on main form

Geek News

Return to record on main form
Judy Ward 12/6/2008 1:14:00 AM
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
Re: Return to record on main form
Tom van Stiphout <tom7744.no.spam[ at ]cox.net> 12/6/2008 3:59:48 AM
On Fri, 5 Dec 2008 17:14:00 -0800, Judy Ward
<JudyWard[ at ]discussions.microsoft.com> wrote:

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


[Quoted Text]
>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

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net