Option Explicit
by manxmanJust a friendly reminder. You need to ALWAYS use Option Explicit. Look at the top of any module of code, whether under forms or modules. The first two lines should be …
Option Compare Database Option Explicit
By default, Access only puts the 1st one. You have two ways of getting the 2nd line in there.
- type it in manually, or,
- under Tools, Options in the VBA editor, turn on “Require Variable Declaration”
What does it do? Forces the “compiler” to make sure that EVERY variable has been declared. Basically, helps stop typos from causing “bugs”.
Just trust me on this one, and do it!