467,132 Members | 1,167 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,132 developers. It's quick & easy.

Importing values from form to module

Is there a way I can import a given value to a variable from the main form
to a module? I wanted to have some routines that are repeated set in a
module subroutine. However, the value of a variable I need to use in the
equations are not read and the equation's result is erroneous. So if I have
a variable to which a value was assigned in the form how can I set it to
have the same value in the module?
Jul 17 '05 #1
  • viewed: 2076
Share:
3 Replies
IS
How about declaring a Global variable?
i.e. Global strSomething as String

"Jason Charalambides" <no****@protectionplan.com> wrote in message
news:YV******************@fe1.texas.rr.com...
Is there a way I can import a given value to a variable from the main form
to a module? I wanted to have some routines that are repeated set in a
module subroutine. However, the value of a variable I need to use in the
equations are not read and the equation's result is erroneous. So if I have a variable to which a value was assigned in the form how can I set it to
have the same value in the module?

Jul 17 '05 #2
"Jason Charalambides" <no****@protectionplan.com> wrote
Is there a way I can import a given value to a variable from the main form
to a module? I wanted to have some routines that are repeated set in a
module subroutine. However, the value of a variable I need to use in the
equations are not read and the equation's result is erroneous. So if I have
a variable to which a value was assigned in the form how can I set it to
have the same value in the module?

How are you calling the module? Could you not pass your variable in
as a parameter?

LFS

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 17 '05 #3
Variables declared Public in a BAS module are available across the project.
Just ensure you do not declare a variable of that same name within a
procedure, or within the general declarations of a form, as when in that
routine or form, VB will use that locally-defined variable and not the
global variable.

--

Randy Birch
MVP Visual Basic
http://www.mvps.org/vbnet/
Please respond only to the newsgroups so all can benefit.
"Jason Charalambides" <no****@protectionplan.com> wrote in message
news:YV******************@fe1.texas.rr.com...
: Is there a way I can import a given value to a variable from the main form
: to a module? I wanted to have some routines that are repeated set in a
: module subroutine. However, the value of a variable I need to use in the
: equations are not read and the equation's result is erroneous. So if I
have
: a variable to which a value was assigned in the form how can I set it to
: have the same value in the module?
:
:
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by qwweeeit@yahoo.it | last post: by
4 posts views Thread by jean-marc | last post: by
2 posts views Thread by enrio@online.no | last post: by
4 posts views Thread by rshepard@nospam.appl-ecosys.com | last post: by
7 posts views Thread by Hussein B | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.