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?
Printable View
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?
Try this:
VB Code:
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.
Nope, no Clipboard in Access. Your code is VB6 Dglienna. Only the Office Clipboard via the DoCmd method.
VB Code:
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
thanks people, that did it.
:-) :thumb:
how do i close a thread?
You can 'Resolve' a thread by going to the Thread Tools menu and selecting 'Resolve Thread'. ;)
:thumb: