MajP
You've got your good things, and you've got mine.
- Local time
- Yesterday, 19:06
- Joined
- May 21, 2018
- Messages
- 9,233
I would think this is a pretty easy functionality to create.
As people said you can put a property on the forms or use the openargs property to store who you were called by. Then set focus when you close to the form you were called by if you were called by another form.
Of course you have the Forms collection and forms are loaded to the collection in order. so you can always close a form and set focus to the last form in the forms collection.
As people said you can put a property on the forms or use the openargs property to store who you were called by. Then set focus when you close to the form you were called by if you were called by another form.
I think if you are having problems setting focus you could roll your own something likeyou even can't set focus to them because they think that they are always in focus.
Code:
Public Sub MySetFocus(frmName As String)
'Ensure it is open
Dim IsOpen As Boolean
Dim frm As Access.Form
For Each frm In Forms
If frm.Name = frmName Then
IsOpen = True
Exit For
End If
Next frm
If IsOpen Then DoCmd.OpenForm frmName
End Sub
Of course you have the Forms collection and forms are loaded to the collection in order. so you can always close a form and set focus to the last form in the forms collection.