JMongi
Active member
- Local time
- Today, 15:47
- Joined
- Jan 6, 2021
- Messages
- 802
I probably butchered that question description...lol!
This is a simple question (I think) but the process has eluded me in the past. The following VBA command works fine:
The extra goodies are using a function to hide the Access application window but it's generally irrelevant to the discussion (I think).
I would like to store the previously opened form name as a global variable so that I can use the same code in my template without changing. Something like...
I seem to struggle using variables in the VBA construct of Some.VBA.Command "NecessaryString" yada, yada where I want to manage the "necessary string". Hopefully I've described this well enough.
Edit: I would clearly need to set the OldForm somewhere else in the code.
This is a simple question (I think) but the process has eluded me in the past. The following VBA command works fine:
Code:
DoCmd.OpenForm "frmOperationsDashboard", , , , , , "AI_Hide"
I would like to store the previously opened form name as a global variable so that I can use the same code in my template without changing. Something like...
Code:
'In a generic module somewhere
Global OldForm as Form
---------------------------
'In my close form button event code'
Application.Echo False
DoCmd.Close acForm, Me.Name
DoCmd.OpenForm OldForm.Name , , , , , , "AI_Hide"
Application.Echo True
I seem to struggle using variables in the VBA construct of Some.VBA.Command "NecessaryString" yada, yada where I want to manage the "necessary string". Hopefully I've described this well enough.
Edit: I would clearly need to set the OldForm somewhere else in the code.