How do you declare a variable to work in multiple forms?

How do you declare a variable to work in multiple forms?

Page 1 of 1

1 Replies - 11864 Views - Last Post: 03 June 2008 - 07:29 AM Rate Topic: -----

#1 donut66  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 03-June 08

How do you declare a variable to work in multiple forms?

Post icon  Posted 03 June 2008 - 06:48 AM

I am new at this and cannot figure out how to make the message someone types into a textbox appear on other forms.
Is This A Good Question/Topic? 0
  • +

Replies To: How do you declare a variable to work in multiple forms?

#2 Public_account  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 37
  • Joined: 16-February 07

Re: How do you declare a variable to work in multiple forms?

Posted 03 June 2008 - 07:29 AM

View Postdonut66, on 3 Jun, 2008 - 06:48 AM, said:

I am new at this and cannot figure out how to make the message someone types into a textbox appear on other forms.


Hi there.
What you want to do is add a module to your project.
Click on "project" on the top bar, and the select "add module.

What a module can do is allow you to do just what you want to do - have variables accessed by other programs.

On there, type

Public MyVariable as String


You can rename myvariable to whatever you want.

What this has done is set up a variable that is "public" - it is shared between any and ALL forms (you can reference to it or from it from any form you make)

Then, have them type in a message into the text box, and then you could have a button, that says

MyVariable = TextboxName.text


Where "TextboxName" is the name of your textbox



Now, whenever you want this message to be referenced, just put

Output = MyVariable


And there you go!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1