Copy text box Contents to clipboard (1 Viewer)

C

Carriolan

Guest
Hi
I am trying to copy the contents of a Text box control to the Clipboard in Access 2003. I have found this logic that I am unable to make work. My textbox is 'Text304'. Further I have no idea what 'sbPanel1.Text' it does or is or whether I need it - Thanks Carriolan

Private Sub Command350_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 'Handles cmdCopyToClipboard.Click
' Takes the selected text from a text box and puts it on the clipboard.
If Text304.Text = "" Then
Clipboard.SetDataObject(Text304.Text) = True
Else
***Text304.Text = "No text selected in the textBox."
End If
********sbPanel1.Text = "Path copied to clipboard."
End Sub
 

ghudson

Registered User.
Local time
Today, 10:10
Joined
Jun 8, 2002
Messages
6,195
Not sure where you found your code but this will set the focus to your text box and copy the value of that text box to the Windows clipboard...

Code:
Me.Text304.SetFocus
DoCmd.RunCommand acCmdCopy
You need to use a standard naming convention with your objects. Naming a text box "Text304" is meaning less.
 

Users who are viewing this thread

Top Bottom