Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Copy() & Paste in TextBox 2

Status
Not open for further replies.

lschwinn

Programmer
Aug 22, 2004
1
0
0
US
I am having a problem with the Copy()& Paste() function. I have a button field where I try to copy from one text field to another. I am typing the following in the Private Sub Button_Click(....)
txtTop.Copy()
txtBottom.Paste()
but the paste doesn't paste my text. It pastes the field name instead. Any help would be appreciated.
 
Before you use the copy function of textbox, you must selected some letter ,just like what you do manually. here are codes below,try it.

txtTop.select(0,100) '100 is you textbox max length
txtTop.Copy()
txtBottom.Paste()
 
If you are copying and pasting the whole text of txtTop to the end of txtBottom, you can try:

txtBottom.text &= txtTop.text

If you would like to replace the contents of txtBottom, you would do:

txtBottom.text = txtTop.text

Happy Programming.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top