UtterAccess.com
Thank you for your support!      
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
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: 152
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
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: 17,221
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
Go to the top of the page
 
+
JabbaTheHutt
post Nov 19 2009, 11:07 PM
Post #4

UtterAccess Addict
Posts: 152
From: Charlotte



thanks to both.
Go to the top of the page
 
+
niesz
post Nov 19 2009, 11:30 PM
Post #5

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



(IMG:http://www.utteraccess.com/forum/style_emoticons/default/thumbup.gif)
Go to the top of the page
 
+

Reply to this topicStart new topic

 



RSS Go to Top  ·  Lo-Fi Version Time is now: 4th February 2012 - 10:43 PM