It might be better programming practice to add a set of property procedures
(Get, and Let/Set) instead of using a public variable. In general, public
variables should be avoided in class modules (and yes, a form is a class
module).
To implement the same property as Kamel did, I would do the following in the
form module:
In the Declarations section:
Private mvarVarName as VarType
Then, at the end of the module, I would add:
Public Property Get VarName() As VarType
VarName = mvarVarName
End Property
Public Property Let VarName (ByVal pNewVarName As VarType)
mvarVarName = pNewVarName
End Property
HTH,
ian
Quote:
> You can declare a Public variable in any form and call it from any other
> form
> if you add this line in the parent form
> Public VarName
> you can call it from your child form or from any other form
> ParentForm.VarName
> the variable will looks like a property of the parent form.
> This call will load the parent form if it is not loaded.
> Kamel
> >With out creating a module to declare a Global Variable, how do I declare a
> >variable in a parent form so the child form called within can access it ??
> >Thanks Much
> >Ryan Shaw