Hai there,
I don't know how to declare a public varible in a standard VB from which I can see in other standard VB forms.
It seems not difficult but I'm stuck,
Please reply,
Chris
Printable View
Hai there,
I don't know how to declare a public varible in a standard VB from which I can see in other standard VB forms.
It seems not difficult but I'm stuck,
Please reply,
Chris
To access a Public variable in a Form from another form you have to use the name of the form to access that variable.
If you don't want to to this, then use a module.
Code:'in second form
msgbox firstForm.VariableName
Put in the declarations section of your form:
Public MyVar as <Datatype>
and call it from other forms like
MyForm.MyVar
Better is though to add a code module to your project (.bas file) and put it in there, that way you don't have to put the formname before the var name.