My Assistant
![]() ![]() |
|
|
Feb 23 2012, 10:52 AM
Post
#1
|
|
|
UtterAccess Ruler Posts: 1,706 From: Sacramento California |
I am using Access 2010.
Is there a way to clear the windows clipboard from within Access? Can this be done by some button on some ribbon? Can it be done with code attached to a button? |
|
|
|
Feb 23 2012, 11:03 AM
Post
#2
|
|
|
Utterly Yorkshire and Forum/Wiki Editor Posts: 15,880 From: Devon UK |
|
|
|
|
Feb 23 2012, 11:24 AM
Post
#3
|
|
|
Access Wiki and Forums Moderator Posts: 47,906 From: SoCal, USA |
Hi Woody,
If API is acceptable and you need a 64-bit version, here it is: CODE Declare PtrSafe Function CloseClipboard Lib "user32" Alias "CloseClipboard" () As Long Declare PtrSafe Function EmptyClipboard Lib "user32" Alias "EmptyClipboard" () As Long Declare PtrSafe Function OpenClipboard Lib "user32" Alias "OpenClipboard" (ByVal hwnd As LongPtr) As Long Sub ClearClipboard() OpenClipboard 0& EmptyClipboard CloseClipboard End Sub Just my 2 cents... (IMG:style_emoticons/default/2cents.gif) |
|
|
|
Feb 23 2012, 01:40 PM
Post
#4
|
|
|
UtterAccess Ruler Posts: 1,706 From: Sacramento California |
Thank you both
I need to clarify and ask a little more. I noticed after my initial question that there is an option on the standard ribbon for doing this. This is located on the Home tab, in the clipboard section by pressing the little arrow in the lower right hand corner. But I may have a different problem. I have a limited amount of ram on my machine (2 gig). I have been doing some queries in a certain app that seems to put a drain on my system. I have noticed that after running several different queries, going back and running some of them again causes the computer to have to wait an inordinate amount of time for the result set. But, I have also noticed that if I close Access and come back in fresh, the problem goes away - at least for a while. When I close Access sometimes it tells me I have a stuff in the clipboard and asks if I want to clear it. So I came to the conclusion, correct or incorrect, that maybe what was happening was that because my clipboard was filling up the queries were running slow because I did not have enough available ram and the machine had do switch some stuff out to the hard drive. Again, this is an assumption on my part. What isn't an assumption is that when I exit Access and come back afresh and run these queries again, they run fine - at least for a while. Could it be something other than the clipboard that's causing the problem? |
|
|
|
Feb 23 2012, 03:11 PM
Post
#5
|
|
|
UtterAccess Ruler Posts: 1,706 From: Sacramento California |
As a follow-up to my last post:
When I close the applicaiton I get a message stating that "This action will cause Brower (the name of the application) to empty the clipboard. Is this what you want?" Out of curosity I say no and then click on the little down arrow in the bottom right corner of the clipboard section of the ribbon under the Home tab. The funny thing is, when this flyout is opened it shows that the clipboard is already empty. This causes me to wonder again if we are talking about two different clipboards. Maybe there is a Windows clipboard for regular copy and paste kind of things and then maybe there is clipboard that is strictly associated with Access. Does anyone know? It's the clipboard associated with Access that I would like to be able to clear, perhaps with a button on the form. I have a 32 bit machine running 32 bit Access 2010. |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th May 2013 - 01:07 PM |