View Full Version : Simple Copy to Clipboard


JChandler22
07-25-2007, 12:39 PM
Hello,

I'm fairly familiar with VBA when it comes to Excel, but Access is another story for me.

I have a form ("Contacts") with a simple text box ("AddressCopyBox"). I have a command button underneath the text box. All I want it to do, on Click, is to copy whatever is in the text box.

Suggestions? Many thanks!

boblarson
07-25-2007, 12:42 PM
Here's a very simple and quick way:

in the click event of the button put:

Me.AddressCopyBox.SetFocus
DoCmd.RunCommand acCmdCopy

JChandler22
07-25-2007, 12:47 PM
Thanks Bob.

Is that code supposed to go in VB? Or just in the command button properties right in MS Access?

I tried to paste it in the properties in Access, and when I clicked the button it said it couldn't find the macro "Me."

Thanks for the quick replies!

boblarson
07-25-2007, 12:52 PM
VBA Window, where all code goes.

JChandler22
07-25-2007, 01:35 PM
Ok Thanks... I've got it working now.

boblarson
07-25-2007, 01:38 PM
glad to hear :)