- Global Variables:
There are circumstances under which global variables lose their values in Access. These circumstances are not common, but they happen often enough to be of concern. One way around this problem is to create a hidden form with unbound controls, each of which would hold the value of one of your global variables. So instead of using a global variable, you set and reference the value of a control on the form.
- Timer events:
If you want run a process at a particular time or multiple times throughout the day, you can create a timer event in a form. This form must be open in order for the timer event to fire. So to keep this form active, but out of the way, you can hide it.
Some forms take a long time to load. This may be because it has a large, bound dataset, or it may be a complex form with several subforms. Whatever the reason, once the form is loaded, it makes sense to not close it again.
I will replace that with the following:
Me.Visible = False
The next time you "open" the form, it will simply make the already open form visible. So instead of opening a Form, you can instantly by make the form visible and set the focus on it like this:
Forms("MyFormName").Visible = True