Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placing Data stored in a variable into a textbox

Status
Not open for further replies.

FreedomP

ISP
Jun 28, 2003
14
CA
I have declared several variables as public and I want the user to make sure that the data they stored in the variables is correct on another form.

But I am not sure how to get the variable into the textbox?

Any help?
 
That is what I assumed would do the job Lazy, but when I run the program the textbox remains blank.
I have a variable, First, publically declared as a string.
And I have a textbox named txtFirst
I tried the txtFirst.text = First but when the program runs the textbox remains blank.
Maybe I have something wrong in how I declared the variable initially.

Public First As String?
 
If you've dimmed them as Public in a Form Module they are public to the form. They can be accessed as Form1.First.

If your form where the variable is Dim'd is Form1, then in Form2 you can use:
Text1.Text = Form1.First

If you want them to be immediately visible evrywhere, then Dim them as Public in a .Bas module (Code module)


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top