Solved

Catch users CTRL+V in a Datasheet form

Posted on 2007-11-22
2
265 Views
Last Modified: 2013-11-28
Hi,
I want to avoid my users to paste rows into a datasheet view form.
How can I do this?
Now the sometimes mess with clicking the row/columnheader block at the very left top area of the datasheet and hit CTRL-V.
Chris
0
Comment
Question by:chriswies
2 Comments
 
LVL 14

Expert Comment

by:bluelizard
ID: 20334571
try this:

1) create a new macro
2) view > macro names (shows 1 more column "Macro Name")
3) in macro name, enter ^V
4) in Action, fill in anything irrelevant, e.g., Beep
5) save the macro under the name "AutoKeys"


--bluelizard

0
 
LVL 27

Accepted Solution

by:
MikeToole earned 500 total points
ID: 20334730
This is the nuclear option, it disables ctl+v for you form entirely:

1) In your form's Event properties, set KeyPreview to Yes (it's the last in the list)
2) Enter the following code for the KeyDown event of your form:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If ((Shift And acCtrlMask) = acCtrlMask) And (KeyCode = vbKeyV) Then
        KeyCode = 0
    End If
End Sub
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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