My Assistant
![]() ![]() |
|
|
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 |
|
|
|
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 |
|
|
|
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 |
|
|
|
Nov 19 2009, 11:07 PM
Post
#4
|
|
|
UtterAccess Addict Posts: 152 From: Charlotte |
thanks to both.
|
|
|
|
Nov 19 2009, 11:30 PM
Post
#5
|
|
|
Utter A-fishin'-ado Posts: 17,221 From: Cincinnati, Ohio, USA . . . ><((((°> |
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 4th February 2012 - 10:43 PM |