Article ID: 198637
Article Last Modified on 12/9/2002
AddFromFile (Module Object)
AddFromFile (References Collection)
AddFromString
AddFromGUID
CreateEventProc
DeleteLines
InsertLine
InsertText
ReplaceLine
Remove (References Collection)
Option Explicit Public pMyVar As String
Sub CreateNewProc()
Dim frm As Form
Dim mdl As Module
Dim ret As Long
'Set Public Variable.
pMyVar = "Hello"
'Create a new form.
Set frm = CreateForm()
Set mdl = frm.Module
'Create an event procedure in the form's module.
ret = mdl.CreateEventProc("Load", "Form")
'Display current contents of Public variable.
MsgBox "pMyVar = " & pMyVar
End Sub
CreateNewProcNote that a form is created with an event procedure, followed by a message box that contains the contents of the public variable.
?pMyVarNote that the public variable is reset and now contains an empty string.
Additional query words: prb global public variables scope
Keywords: kbprb KB198637