Alternatives to Public Variables in VBA

前端 未结 5 964
萌比男神i
萌比男神i 2020-12-06 08:00

I have a number of public variables that are referenced across several modules. I know if you debug or hit stop the variable gets cleared out. I have been writing these vari

5条回答
  •  臣服心动
    2020-12-06 08:15

    The TempVars Collection is a great alternative to Public Variables. It won't persist between sessions, but it will persist for the entirety of A session.

    You will need to add a reference to Microsoft Access 14.0 Object Library though. TempVars are only available from 2007 onward.

提交回复
热议问题