Calling Private Functions on forms

  • Thread starter Thread starter manchery
  • Start date Start date
M

manchery

Hi,

I have a private function named "App_Status" and that
function calls some other private functions. I would like
to get a value from function (app_status) to use in many
forms. I have assigned a public variable in Class ,,
Public a_status as string.
How can i call this variable in other forms.
Any assistance pls...
 
I have a private function named "App_Status" and that
function calls some other private functions.

Private to what? A form, a module, or a class?
I would like
to get a value from function (app_status) to use in many
forms.

In that case, it will have to be public
I have assigned a public variable in Class ,,
Public a_status as string.
How can i call this variable in other forms.

You'll have to create an instance of the class, and then read the property.

Either

' put this at the top of a normal module
' creates a publically-accessible instance of the class
' just remember never to destroy it!

Public stat As New CStatusClass

' then in some normal code, you can just use the property

If stat.a_status = True Then...



Or
' create a new CStatusClass object whenever it is needed
' this is within a procedure
'
Dim stat As CStatusClass

Set stat = New CStatusClass
If stat.a_status = False Then Call Something

etc.

Hope that helps


Tim F
 
Back
Top