can't access fom1.vb data from another module

  • Thread starter Thread starter Patrick Sullivan
  • Start date Start date
P

Patrick Sullivan

I have a data input form with a structure that gets loaded with the input
data. I have a module calc.vb with lots of calculations to do on the data in
the structure. But I can't access the strutcure's data from the calc module,
even though both are public. What other declarations can I do to make it
accessible?
 
Patrick said:
I have a data input form with a structure that gets loaded with the input
data. I have a module calc.vb with lots of calculations to do on the data in
the structure. But I can't access the strutcure's data from the calc module,
even though both are public. What other declarations can I do to make it
accessible?

It would help to see your code. how are you trying to access the data?
Does Calc.vb module get passed a reference to Form1? If you don't
pass a form1 object to the calc functions, how it is suppose to see the
variables?

Chris
 
Duh, that sounds like a good idea. I am a C programmer trying to do this, C
seems more straightforward to me. Thanks!
 
Patrick Sullivan said:
I have a data input form with a structure that gets loaded with the input
data. I have a module calc.vb with lots of calculations to do on the data
in
the structure. But I can't access the strutcure's data from the calc
module,
even though both are public. What other declarations can I do to make it
accessible?


If you are using VB 2005, you may want to use form default instances. You
can access a form's default instance using 'My.Forms.<form name>.<member
name>'.
 
I fixed it. Passed a referrence to the structure in the form class from the
sub procedure to the external function. Now I got other problems.
 

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

Back
Top