Link to home
Start Free TrialLog in
Avatar of Hiroyuki Tamura
Hiroyuki TamuraFlag for United States of America

asked on

MS Access question

I would like to create a copy button, just select field and copy text.
would you advise me?
User generated image
Avatar of COACHMAN99
COACHMAN99

copy to where? (clipboard?)
Avatar of Hiroyuki Tamura

ASKER

yes
Dim clipboard As MSForms.DataObject
Set clipboard = New MSForms.DataObject
clipboard.SetText your source field (i.e. your text box)
clipboard.PutInClipboard
I'm getting this error.
User generated image
did you set a reference to the library?
For using MSForms.DataObject in your code you need library “Microsoft Forms 2.0 Object Library”

Some­times you won’t find the desired ref­er­ences in the list, say you won’t find “Microsoft Forms 2.0 Object Library” in the tool/reference list in that case you need to browse the FM20.DLL file from the system32
Also, I would not use 'copy' as your field name. try txtCopy or some other non-system / non-reserved word. - this isn't related to your error message, just a note :-)
Avatar of Dale Fye
Why not simply use the built-in right click menu?
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thank you
You are welcome!

/gustav