Solved

Catch users CTRL+V in a Datasheet form

Posted on 2007-11-22
2
241 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now