|
-
Sep 21st, 2007, 02:39 PM
#1
Thread Starter
Lively Member
Label To Display User Name
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
-
Sep 21st, 2007, 02:54 PM
#2
Addicted Member
Re: Label To Display User Name
Code:
Private Sub Text1_Change()
Form2.Label1.Caption = Text1.Text
End Sub
Something like this?
 Originally Posted by Vanasha
Sorry, i'm slow.
-
Sep 21st, 2007, 03:03 PM
#3
Hyperactive Member
Re: Label To Display User Name
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.
 Originally Posted by Jamiex
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 
-
Sep 21st, 2007, 04:42 PM
#4
Addicted Member
Re: Label To Display User Name
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
-
Sep 24th, 2007, 10:29 AM
#5
Re: Label To Display User Name
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|