PDA

View Full Version : Solved: Is it possible to automatically change textboxes using data filled in one of them?



firas
09-26-2011, 11:25 PM
Hi everyone
I have a user form that contains many field one of them a Textbox "full name" is repeated many times. Is it possible that when the user fills out his / her name in the first textbox field that all other related fields change automatically to have the same text entered in the first Textbox field?
Example:

Full name: John S. A.
I am writing you to inform about Mr.: "John S. A to be filled out automatically". I have being known Mr.: "John S. A to be filled out automatically". Blablablabla

Any suggestions
Thanks

gmaxey
09-27-2011, 04:28 PM
Why would you want to repeat information on the "UserForm?" There purpose of the userform is gather information for use in final document. Fill out name once and use it to populate as many places as you like in in the document. See: http://gregmaxey.mvps.org/Create_and_employ_a_UserForm.htm

If you must duplicate it in the userform this use the _Change event:

Private Sub TextBox1_Change()
TextBox2.Text = TextBox1.Text
TextBox3.Text = TextBox1.Text
TextBox4.Text = TextBox1.Text
End Sub

firas
09-27-2011, 10:58 PM
:clap2:
Thank you Gmaxey
The only thing I can say is "As always you are great"
Thank you
I tried to do it and it worked perfect using userform, the only problem I have is how to insert it to my word document. WHAT YOU CONSIDER SILLY, FOR ME IT IS A JEWEL:banghead: . Could you attach a word Doc file?

Sorry for my ignorance firstly and for my English secondly
Thanks again

gmaxey
09-28-2011, 04:23 AM
You can download an example Word document that contains code for transferring data from the form to the document using the like I provided.

firas
09-28-2011, 05:27 AM
Ok
Thanks a lot