Click to See Complete Forum and Search --> : copy
parker
Jul 22nd, 2005, 05:55 PM
hi
new to vba.
if i have a textbox on a form in access (2000) and a button called 'copy', which command do i place behind this button to copy the contents of the textbox to my clipboard?
ive tried .copy
is it something to do with the do.cmd?
dglienna
Jul 23rd, 2005, 07:50 PM
Try this:
Private Sub mnuCopy_Click ()
Clipboard.Clear
Clipboard.SetText Text1.SelText
End Sub
EDIT: Oh, just noticed that you wanted to use VBA. Not sure if that will work, try using HELP.
RobDog888
Jul 24th, 2005, 01:21 AM
Nope, no Clipboard in Access. Your code is VB6 Dglienna. Only the Office Clipboard via the DoCmd method.
Private Sub BtnCopy_Click()
Me.txtTextBox.SelStart = 0
Me.txtTextBox.SelLength = Len(Me.txtTextBox.Text)
DoCmd.RunCommand acCmdCopy 'Copies the selected contents of txtTextbox control
End Sub
parker
Jul 24th, 2005, 04:23 PM
thanks people, that did it.
:-) :thumb:
parker
Jul 24th, 2005, 04:25 PM
how do i close a thread?
RobDog888
Jul 24th, 2005, 08:24 PM
You can 'Resolve' a thread by going to the Thread Tools menu and selecting 'Resolve Thread'. ;)
:thumb:
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.