Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MS Access question

Posted on 2016-10-06
11
Medium Priority
?
78 Views
Last Modified: 2016-10-07
I would like to create a copy button, just select field and copy text.
would you advise me?
Snap1277.jpg
0
Comment
Question by:Hiroyuki Tamura
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 41832243
copy to where? (clipboard?)
0
 

Author Comment

by:Hiroyuki Tamura
ID: 41832316
yes
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 41832327
Dim clipboard As MSForms.DataObject
Set clipboard = New MSForms.DataObject
clipboard.SetText your source field (i.e. your text box)
clipboard.PutInClipboard
1
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 

Author Comment

by:Hiroyuki Tamura
ID: 41832392
I'm getting this error.
Snap1278.jpg
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 41832410
did you set a reference to the library?
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 41832417
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
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 41832424
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 :-)
0
 
LVL 48

Expert Comment

by:Dale Fye
ID: 41832679
Why not simply use the built-in right click menu?
0
 
LVL 51

Accepted Solution

by:
Gustav Brock earned 2000 total points
ID: 41833066
It is much simpler. No reference is needed:
Private Sub ButtonCopyToClipboard_Click()

    Me!YourTextboxName.SetFocus
    Me!YourTextboxName.SelLength = Len(Me!YourTextboxName.Text)
    DoCmd.RunCommand acCmdCopy
    
End Sub

Open in new window

/gustav
0
 

Author Closing Comment

by:Hiroyuki Tamura
ID: 41833760
thank you
0
 
LVL 51

Expert Comment

by:Gustav Brock
ID: 41833779
You are welcome!

/gustav
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question