clipboard warning

B

Blitz

When I close a form after updating changes to a record, I
get the error message:- "You copied a large amount of data
onto the Clipboard. When you copy data onto the Clipboard,
only the reference to the object is copied. If you close
the source document, however, Microsoft Access must paste
all the data from its source. Depending on the amount of
data, this can take some time. Do yo want to save this
data on the Clipboard?"

Is there any VBA (or anything else) I can use to help me
avoid this message?
 
B

Blitz

i understand what you're getting at. the reason it is
asking this is that when i update/change any info in a
particular record it has to be inserted into the table as
a new record. hence, it copies all the data with the
changes then makes it a new record entry.
 
G

Guest

-----Original Message-----
i understand what you're getting at. the reason it is
asking this is that when i update/change any info in a
particular record it has to be inserted into the table as
a new record. hence, it copies all the data with the
changes then makes it a new record entry.
-- Ok, so what you are doing is *copying* a record to a
new record, making the changes to this new record and
deleting the old one? Am I correct?
 
B

Blitz

almost correct. i am copying the record, but i also have
to keep the old record i order to track changes.
 
L

Leonard Selmani

Ok then. What you can do then is set the warnings. Like
this:
(inside your function or Sub, right at the top, but after
any OnError statements)
DoCmd.SetWarnings False

'perform your operations here

'you should set the warnings to True before you exit
'any form or application, otherwise users will not
'see any warnings. usually you set the warnings
'true after you are
'done with an operation

DoCmd.SetWarnings True

that should do it
 
S

Stephen Lebans

An alternative would be to programmatically clear the clipboard before
closing the form.

' Place these API declarations at the top of your Form in the General
Declarations area.
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 cmdClip_Click()
On Error GoTo Err_cmdClip_Click

' Open, Empty and Close Clipboard
' No Clipboard API error handling
Call OpenClipboard(0&)
EmptyClipboard
CloseClipboard
MsgBox "ClipBoard Cleared!"


Exit_cmdClip_Click:
Exit Sub

Err_cmdClip_Click:
MsgBox Err.Description
Resume Exit_cmdClip_Click

End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
T

TC

Or easier: move the cursor to an empty textbox, then:

docmd.runcommand accmdcopy

or somesuch - I don't have Access here to check.

This is also not a bad way of copying arbitrary text to the clipboard,
without the hassle of APIs.

TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top