doCmd for copying to clipboard (1 Viewer)

sambucaman

Registered User.
Local time
Today, 10:19
Joined
May 6, 2010
Messages
41
Hi guys,

I've tried searching but to no avial. I'm looking for some simple code for copying text to the clipboard so I can later paste it to another app.

My field i need the text from is "me.stores.address"

any help or ideas would be really appreciated.

Thanks

Andy
 

sambucaman

Registered User.
Local time
Today, 10:19
Joined
May 6, 2010
Messages
41
thanks - I had actually read that page, and tried a few of their suggestions, but nothing seems to work. I have a form with name, address, telephone etc, and id like to be able to copy ONLY the address.


Any other suggestions, or am i missing something simple?
Thanks :)
 

mdlueck

Sr. Application Developer
Local time
Today, 13:19
Joined
Jun 23, 2011
Messages
2,631
I have a form with name, address, telephone etc, and id like to be able to copy ONLY the address.

rrrr???? I would think each of those attributes is in its own field, ja? I would think if you put the suggested code to use, that it would only copy the one field.

So what in your form has all of the contact information? Perhaps you are sending the incorrect object to the clipboard?
 

AkinwaleAkin

New member
Local time
Today, 19:19
Joined
Mar 30, 2012
Messages
3
Hi,

to copy

me.stores.address.setfocus
docmd.runcommand accmdcopy

to paste use

docmd.runcommand accmdpaste

Regards,

AkinwaleAkin
 

sambucaman

Registered User.
Local time
Today, 10:19
Joined
May 6, 2010
Messages
41
Hi guys
I have now got it workiny by using the following.
Dim DataObj As New MSForms.DataObject
Dim S As String
S = Me.Stores_Address
DataObj.SetText S
DataObj.PutInClipboard

It didn't work earlier as FM20.dll was not referenced in tools / reference. As soon as I manually referenced this, it all started to work.

Happy days. Thanks :)
 

Users who are viewing this thread

Top Bottom