acCopy

  • Thread starter Thread starter kennytwk via AccessMonster.com
  • Start date Start date
K

kennytwk via AccessMonster.com

hi,

how do i copy a value from a textbox (text0) to the clipboard when i click on
a command button.

DoCmd.MenuItem ....., acCopy

That's as far as i know, can someone enlighten me?
 
Hi Kenny,

First you need to return the focus from the commandbutton to the
textbox. If you use

Screen.PreviousControl.SetFocus

it will go back to whatever control had the focus before you clicked the
button, which means you can use the same button to copy the contents of
more than one control. Then use

DoCmd.RunCommand acCmdCopy

rather than the archaeological DoCmd.MenuItem.
 

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

Back
Top