JabbaTheHutt
Nov 19 2009, 04:21 PM
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
Bob_L
Nov 19 2009, 05:14 PM
One simple one is just
CODE
Me.YourTextBoxField.Locked = False
Me.YourTextBoxField.SetFocus
DoCmd.Copy
Me.AnotherControlToSetFocusTo.SetFocus
Me.YourTextboxField.Locked = True
niesz
Nov 19 2009, 05:44 PM
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