Public variable

D

Denisio

Hi,
Sorry for my bad english.

I declare a public variable in a formcode : Public VAR as integer
I never can use it in an other formcode... unknown variable
Probably something wrong. How to spell this public variable ?
Thanks for your help.
 
G

Graeme Richardson

To reference a public variable declared in a different form, you need to
include the form name in the reference

E.g. if Form1 has the declaration
Public var1 As Integer

To refere to it in any other form then use
localVariable = Form1.var1

To declare a global variable then create a new module and place the
declaration in there.

Graeme.
 
D

Denisio

Thank you Graeme
It works well.
I never found exemples about it in Microsoft Access helps !
Denis
 

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