copy text in textbox to another textbox on click

copy text in textbox to another textbox on click

Post by leon.jos » Thu, 31 Mar 2005 23:51:49

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

 
 
 

copy text in textbox to another textbox on click

Post by PC Datashe » Fri, 01 Apr 2005 00:22:42

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

Me!NameOfSecondTextbox = Me!NameOfFirsttextbox

 
 
 

copy text in textbox to another textbox on click

Post by ZGFycmV » Fri, 01 Apr 2005 00:43:05

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 = ""
 
 
 

copy text in textbox to another textbox on click

Post by Dan Artus » Fri, 01 Apr 2005 00:47:47

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.

--
HTH
-------
Dan Artuso, MVP