Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing the Clipboard 1

Status
Not open for further replies.

JHeimall

MIS
Nov 8, 2002
14
US
I am looking for a way to clear the clipboard. I am running into a problem where I am using the clipboard to duplicate a record. However, when you exit the form it prompts you to save the items on the clipboard and I always want that to not be saved so if you get back in to make a copy the old clipboard data is not there again to be pasted. I tried to do an INSERT query using SQL language but I was having problems there as well, however, it may be the better way to go. Any help would be great...Thanks!!
 
Try this code:

Private Declare Function OpenClipboard Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Declare Function EmptyClipboard Lib "user32" () As Long


Private Sub Clear_Clipboard_Click()

If OpenClipboard(0&) Then
Call EmptyClipboard
Call CloseClipboard
End If

End Sub
Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top