I am looking for a way to store a form's name when it gets the focus so that if I move the focus to another form, it knows where it was accessed from.
For testing purposes I am putting a msgbox on the subsequent forms to show me the name of the form that I just came from. I am dealing with modal forms and the got or lost focus behaves differently in those cases I believe.
what I have for now on form ACTIVATE:
Option Compare Database
Public PreviousScreen As Form
Public PreviousForm
Function RememberMe()
Set PreviousScreen = Screen.ActiveForm
PreviousForm = PreviousScreen.Name
End Function
Then when I open another form (for testing purposes) I have:
Function WhereFrom()
MsgBox PreviousForm & " just Lost the focus"
End Function
This does not work. It gives me the name of the form that I am accessing.
I guess I just don't know what to use: Open, Load, Activate.
I feel I am close but there's that certain Je ne sais quoi
that's missing.
Thanks for any suggestion.
Mike
For testing purposes I am putting a msgbox on the subsequent forms to show me the name of the form that I just came from. I am dealing with modal forms and the got or lost focus behaves differently in those cases I believe.
what I have for now on form ACTIVATE:
Option Compare Database
Public PreviousScreen As Form
Public PreviousForm
Function RememberMe()
Set PreviousScreen = Screen.ActiveForm
PreviousForm = PreviousScreen.Name
End Function
Then when I open another form (for testing purposes) I have:
Function WhereFrom()
MsgBox PreviousForm & " just Lost the focus"
End Function
This does not work. It gives me the name of the form that I am accessing.
I guess I just don't know what to use: Open, Load, Activate.
I feel I am close but there's that certain Je ne sais quoi
Thanks for any suggestion.
Mike