Public variable not holding value

  • Thread starter Thread starter rhovey
  • Start date Start date
R

rhovey

I have a variable defined in the module of my main form
as "Public varyear as integer". I set the value in one
subform, then need to use it in a different subform.
However, when the code in the second subform tries to use
the value it is empty. Any idea what I may be doing wrong?
 
rhovey said:
I have a variable defined in the module of my main form
as "Public varyear as integer". I set the value in one
subform, then need to use it in a different subform.
However, when the code in the second subform tries to use
the value it is empty. Any idea what I may be doing wrong?


What events are you using to set and use the variable?

Is it possible that you're referring to the value before
it's set?

How are you referring to the variable? You must get to it
threough the parent form object - Me.Parent.varyear

Are you sure you declared the variable in the form module's
declaration section and not in a procedure?
 
Back
Top