C
Chris
Hi...hoping for some guidance.
Two forms: [MainForm], [PopUpForm], each bound to different table.
Button on [MainForm] calls [PopUpForm].
Button on [PopUpForm] closes [PopUpForm] and focus goes back to [MainForm].
When [MainForm] gets focus again, the first record is displayed. I know what
causes this; I don't wish to change that situation -- but I would like to
return to the record I left. I successfully use the following code several
places, however, its always only ONE form, such as [MainForm]. In this case I
have two forms; one called ([PopUpForm]) and one "underlying" ([MainForm]).
Thus, I think the code belongs in the called form ([PopUpForm]) but I don't
know how to modify it.
Code:
Dim strClientID as String
strClientID=Me!ClientID
Me.Requery
With Me.RecordsetClone
.FindFirst "ClientID=""" & strClientID & """"
If .NoMatch = False Then
Me.Bookmark = .Bookmark
Else
.Bookmark=Me.Bookmark
End If
End With
ClientID is a control on each form.
Can anyone be of assistance?
Two forms: [MainForm], [PopUpForm], each bound to different table.
Button on [MainForm] calls [PopUpForm].
Button on [PopUpForm] closes [PopUpForm] and focus goes back to [MainForm].
When [MainForm] gets focus again, the first record is displayed. I know what
causes this; I don't wish to change that situation -- but I would like to
return to the record I left. I successfully use the following code several
places, however, its always only ONE form, such as [MainForm]. In this case I
have two forms; one called ([PopUpForm]) and one "underlying" ([MainForm]).
Thus, I think the code belongs in the called form ([PopUpForm]) but I don't
know how to modify it.
Code:
Dim strClientID as String
strClientID=Me!ClientID
Me.Requery
With Me.RecordsetClone
.FindFirst "ClientID=""" & strClientID & """"
If .NoMatch = False Then
Me.Bookmark = .Bookmark
Else
.Bookmark=Me.Bookmark
End If
End With
ClientID is a control on each form.
Can anyone be of assistance?