UtterAccess.com

Welcome Guest ( Log In | Register ) · View New Posts · View Unanswered Topics

 
Reply to this topicStart new topic
> Copying info to your clipboard using VBA...
 
   
JabbaTheHutt
post Nov 19 2009, 04:21 PM
Post #1

UtterAccess Addict
Posts: 151
From: Charlotte



HI!

OK, let's say there's a form with a text box that is Enabled=False, Locked=True so the users can see it, but not click in it andmonkey with it.

I want to be able to add a button to the form where a user can click the button and then have the contents of the above mentioned text box in thier clipboard so they can paste it into an email or whatever.

what would the code the for on click event of the button be?

Thanks


--------------------
Jabba The Hutt

e-now kom bantha poo-doo
ha ha ha ho ho ho
Go to the top of the page
 
+
Bob_L
post Nov 19 2009, 05:14 PM
Post #2

Utterly Banned
Posts: 7,038



One simple one is just

CODE
Me.YourTextBoxField.Locked = False
Me.YourTextBoxField.SetFocus
DoCmd.Copy
Me.AnotherControlToSetFocusTo.SetFocus
Me.YourTextboxField.Locked = True
Go to the top of the page
 
+
niesz
post Nov 19 2009, 05:44 PM
Post #3

Utter A-fishin'-ado
Posts: 16,440
From: Cincinnati, Ohio, USA . . . ><((((°>



Try:

Me.Text0.Enabled = True
Me.Text0.SetFocus
DoCmd.RunCommand acCmdCopy
Screen.PreviousControl.SetFocus
Me.Text0.Enabled = False

You may also want to check out:
http://www.mvps.org/access/api/api0049.htm


--------------------
Walter Niesz | Microsoft Access MVP | Link Library
"By iron, iron itself is sharpened. So one man sharpens the face of another."
Go to the top of the page
 
+
JabbaTheHutt
post Nov 19 2009, 11:07 PM
Post #4

UtterAccess Addict
Posts: 151
From: Charlotte



thanks to both.


--------------------
Jabba The Hutt

e-now kom bantha poo-doo
ha ha ha ho ho ho
Go to the top of the page
 
+
niesz
post Nov 19 2009, 11:30 PM
Post #5

Utter A-fishin'-ado
Posts: 16,440
From: Cincinnati, Ohio, USA . . . ><((((°>



thumbup.gif


--------------------
Walter Niesz | Microsoft Access MVP | Link Library
"By iron, iron itself is sharpened. So one man sharpens the face of another."
Go to the top of the page
 
+

Reply to this topicStart new topic

 



RSS Lo-Fi Version Time is now: 30th July 2010 - 11:19 AM

Tag cloud: