copy text in textbox to another textbox on click

L

leon

I have a form with two textboxes. I want to be able to copy and paste
the text in the first textbox to the the second textbox by using a
command button which is placed on the same form. Is this possible?

Any help is very much appreciated
 
P

PC Datasheet

Put the following code in the button's Click event:

Me!NameOfSecondTextbox = Me!NameOfFirsttextbox
 
G

Guest

Leon -- This is possible.

If your form had two text boxes named Text1 and Text2 create a command
button and use code in the OnClick Event of the command button that is
similar to this this:

To "copy and paste" the text from Text1 to Text2

Text2 = Text1

If you wanted to "cut and paste" from text1 to text2, try

Text2 = Text1
Text 1 = ""
 
D

Dan Artuso

Hi,
Well, sure, just do this:
Me.ControlToCopyTo = Me.ControlToCopyFrom

Is it a good idea? Probably not. There's never a need to store data in more than one place.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Textbox to Textbox!! PLEASE HELP 17
setfocus on textbox 8
textbox event 2
textbox info based on cbo 1
textbox for gradual filtering 1
textbox movement 1
Update textbox from option group 5
Textbox result 2

Top