ClearClipboard()...

Place in your modUtilities or in a new Module, remembering not to name the Module the same as the Function, and save.  To use place... Call ClearClipboard ...wherever you need to clear the Clipboard.
Place the code below at the very top below...

Option Compare Database
Option Explicit
The difficult I do immediately, the impossible takes a little bit longer.
Function ClearClipboard() As Boolean
On Error GoTo err_ClearClipboard
' Comments : Clears the clipboard
' Parameters: None
' Returns : True if successful, False otherwise
'
     Dim lngTemp As Long
 
          If clt_OpenClipboard(0&) <> 0 Then
            lngTemp = clt_EmptyClipBoard()
            lngTemp = clt_CloseClipboard()
          End If
 
     ClearClipboard = True
 
exit_ClearClipboard:
Exit Function
 
err_ClearClipboard:
ClearClipboard = False
Resume exit_ClearClipboard
 
End Function
Declare Function clt_OpenClipboard Lib "user32" Alias "OpenClipboard" (ByVal hWnd As Long) As Long
Declare Function clt_CloseClipboard Lib "user32" Alias "CloseClipboard" () As Long
Declare Function clt_EmptyClipBoard Lib "user32" Alias "EmptyClipboard" () As Long
VBA
Tips (Main)
Home
Creating a Multi-Value field using Alphabet
Copy Fields Down from above Record
Loop thru records and OutPutTo seperate .RTF or .PDF
Modified Spell Check
Code Snippets
Lock\Unlock Bound Controls
Loop while renumbering two columns
Create a Table with Dynamic Field Names
Snippets for Exporting to Excel
Log Field Changes
Log Record Deletions
Check for Duplicate Values
ValidateData()
Selecting an Excel Worksheet from Access
Send eMail to Multiple Recipients
Cancel Save in a Bound Form
Automatically Send eMail Notifications
fFindBookmark()
Looping Records to Send eMail
fxlFindReplace()
This site uses cookies to collect data on usage. By continuing to browse this site you consent to this policy. Find out more here.