Solved

Catch users CTRL+V in a Datasheet form

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

919 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

17 Experts available now in Live!

Get 1:1 Help Now