Public variable not holding value

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?
 
M

Marshall Barton

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top