declaring global variables.

  • Thread starter Thread starter Raj
  • Start date Start date
R

Raj

Guest
Hi,

I'm new to this forum and I apologize if this topic is in the wrong section.

I'm basically having trouble trying to declare a string variable that's global to all forms in a particular project. I've tried going through the microsoft access help section and I've also tried doing a forum search but so far I haven't had any luck.

Could someone please tell me how to declare global variables in access? If the question isn't clear for any reason, I'll gladly elaborate.

Thanks,

Raj
 
Found this thread and I was wondering, once I have declared public variable in my form, do I need to include the module name at the beginning of my form I want to use? Sort of clueless about where to go from here. :confused:

Right now I have a module that just declares a public variable but when I try to use it in a form, it doesn't do anything. I must be missing a step.
 
You have to Declare the Public Variable in a stand alone module
Public MyNumber As Long

to pass a value to it from a form, on some event just
MyNumber = Me.SomeField
or
MyNumber = 10 etc
 
Ahh. Thanks. I had it originally declared at the top of my form. :o
 

Users who are viewing this thread

Back
Top Bottom