473,395 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

how to disable control + X in Access 2010 Forms

I have a form bound to table.When i open the form and press control + A it jumps to first record, that is not the problem but when i press control + x it deletes the record from table how do i stop that
i am trying code below but its not working
Expand|Select|Wrap|Line Numbers
  1.         Case vbKeyControl + X
  2.             MsgBox "CAN NOT DELETE"
  3.             KeyCode = 0
  4.  
The code is on key down event of form
Jan 13 '14 #1
5 2097
zmbd
5,501 Expert Mod 4TB
There are ways to bypass a key trap.
Instead, set the form to not allow record deletions:
Open form in design view
Open the form's property sheet
Select the data tab
Set property [Allow Deletions] = No
Jan 13 '14 #2
NeoPa
32,556 Expert Mod 16PB
If it's simply Ctrl+X that you want to stop, then your code won't work. It is not correct. Unfortunately you haven't included most of the important code so we can't explain why, or what to change to get it to work. When done properly it can work.

On the other hand, if it's all deleting you want to stop, then the alternative approaches are far more sensible, as the code for Ctrl+X, even when working correctly, will only block the delete when requested by Ctrl+X (and there are many other ways to get a record to be deleted).
Jan 14 '14 #3
I used AutoKeys Macro
If someone needs help then i think i should explain
Create macro name of macro should be AutoKeys (case sensitive it is)
then submacro and submacro name should be key which you want to disable
Which is ^X means control + X

Thanks Neopa and z for ur replys
regards
Aug 28 '14 #4
zmbd
5,501 Expert Mod 4TB
As I mentioned in #2, there are ways around even the AutoKeys macro. Even if the user doesn't do one of these workarounds, the AutoKeys has the disadvantage if being global.
IMHO, #2 is the better method and Neopa's comments are still valid.
Aug 28 '14 #5
NeoPa
32,556 Expert Mod 16PB
I agree strongly. Using an AutoKeys macro for this purpose is inadequate in many ways. It is also much more complicated than necessary. This isn't even a choice - The way to do it should be to set Allow Deletions to No.
Aug 29 '14 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: sierra7 | last post by:
It seems Access 2010 is associating an 'input mask' or field type with a combo box when a form is opened, even though there is no Format setting on the control. I have a form which has been...
1
by: Alan Yim | last post by:
Hi folks, My company recently upgraded our Office suite from 2003 to 2010. The problem in particular is with an Access database that was originally designed in Access 2003. The code in question...
5
by: neelsfer | last post by:
I got a new work laptop last week with Access 2010 pre-loaded.I also installed the new Office 2010 service pack 1. I then loaded 2 of my regularly used Access 2007 + service pack 2 applications on...
4
by: jbrumbau | last post by:
Hello, In Access 2010/2007, how do you prevent users from flipping into design view from the ribbon? I do not want to hide the entire ribbon (DoCmd.ShowToolbar "Ribbon", acToolbarNo) or even the...
1
by: billwilson | last post by:
IS there a way to disable the Access 2010 Hyperlink Security warning(s) without changing the registry? If not, is the registry change the same as 2007? I am running XP. Thanks in advance, ...
4
beacon
by: beacon | last post by:
Hi everybody, My title may not exactly describe my issue, so please forgive my lack of creativity today. I've got a database that was created in Access 2003 that I've opened in Access 2010. I...
2
by: shannonsims | last post by:
In an effort to digitize our personnel files, I am currently building an Access database that tracks stores employee information, to include admin documents, leave requests, training docs etc. After...
11
by: Redbeard | last post by:
I have just upgraded to Access 2010 (64 bit) from Access 2007. There were a few minor issues in the database which I have resolved but this one piece of code just won’t work. I do not write VBA but...
2
by: Redbeard | last post by:
I need to save my Access 2010 database in 2003 format so that someone can use it that is only running 2003. My database was built using Access 1997 and has been upgraded over the years to 2003, 2007...
3
by: rahul2310 | last post by:
I want to disable function keys in access 2010,for that i am using code on forms on key down event. Code is 'The forms Key Preview property must be set to Yes Private Sub Form_KeyDown(KeyCode As...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.