473,385 Members | 1,326 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,385 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 2096
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.