Hi
I have a textbox on one of my forms that has to remember the name the user enters. Then on another form it has to display the name the user entered on a label. I tried but have failed so i was wondering if anybody could help.
Thanks
Jamie:)
Printable View
Hi
I have a textbox on one of my forms that has to remember the name the user enters. Then on another form it has to display the name the user entered on a label. I tried but have failed so i was wondering if anybody could help.
Thanks
Jamie:)
Something like this?Code:Private Sub Text1_Change()
Form2.Label1.Caption = Text1.Text
End Sub
Well this isnt anything fancy.
But lets say on form1 you have your textbox.
On a button click i put
Form2.Label1 = Text1.Text
Form2.Show
Form2 with my label pops up with the name.
Probably better ways,, some way of storing it in a variable in a class.
But that looks basic to me.
Quote:
Originally Posted by Jamiex
You could store the label caption in a variable in a module
in Form1
call StoreInModule(label1.caption)
in Module
dim StoreTxt as string
Public sub StoreInModule(LblTxt as string)
StoreTxt = LblTxt
end sub
Public Function GetFromModule() as string
GetFromModule = StoreTxt
EndFunction
in Form2
Label2.caption = GetFromModule
Just store the username in a public variable in a module and you can us it on any form in your project.
How are you getting the username?