G
Guest
I have a form which has a subform.
The subform has a private variable, declared at the top of the code so it
should have (sub)form-wide scope:
Private lngCoID as long
The subform loads first, in the process of which it sets (in the load event)
the value of the private variable as in:
lngCoID = (value I fetched when I started up)
This value is available to the outside world through a property of the
subform, as:
Property Get Coid() As Long
Coid = lngCoID
End Property
In the form_load event of the main form, the main form asks the subform for
the value, as:
id = Form_subform.Coid
The funny thing is, when the main form, in it's load event, asks the subform
what the value in question is, the subform returns 0, even though when it
loaded and set lngCoid, the value originally was not 0!
What happened to the value of lngCoID between the time the subform set it,
and the time the main form asked for it?
Thanks in advance for any help.
Fred
The subform has a private variable, declared at the top of the code so it
should have (sub)form-wide scope:
Private lngCoID as long
The subform loads first, in the process of which it sets (in the load event)
the value of the private variable as in:
lngCoID = (value I fetched when I started up)
This value is available to the outside world through a property of the
subform, as:
Property Get Coid() As Long
Coid = lngCoID
End Property
In the form_load event of the main form, the main form asks the subform for
the value, as:
id = Form_subform.Coid
The funny thing is, when the main form, in it's load event, asks the subform
what the value in question is, the subform returns 0, even though when it
loaded and set lngCoid, the value originally was not 0!
What happened to the value of lngCoID between the time the subform set it,
and the time the main form asked for it?
Thanks in advance for any help.
Fred