• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

Global variables

I am fairly new to VB and I am working on aan application that has a number of forms and controls. I need to store the Combo Box selection of one form in a global variable and be able to check that value in another form. I tried declaring a public variable in the form where I was setting its value and checked the value of that variable in the other form. It didn't work.

Thanks for any help.
1 Solution
if a public is declared in form1 then you get it in another form as

kavintAuthor Commented:
Thanks for your suggestion.
I know its too late but , since i have seen now, just for the record avoid using Global variables if possible.
1)create a public function and and pass var to its arguments
2) if u want to use global variables u can even declare var in .bas file apart from the suggestion given by Deighton.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now