Global Variable within form

D

dhstein

In VBA can I have a variable that is global only within the form. What I
mean is that only the events that are part of the form will use it. Events
on other forms will not have access to it. I hope that's clear and thanks
for any help.
 
D

Douglas J. Steele

Declare the variable at the top of the form's module, before any code. Just
use the Dim keyword, not the Public one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top