copy text in textbox to another textbox on click

  • Thread starter Thread starter leon
  • Start date Start date
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
 
Put the following code in the button's Click event:

Me!NameOfSecondTextbox = Me!NameOfFirsttextbox
 
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 = ""
 
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.
 
Back
Top