Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using 'Ctrl + Del' to delete a record 1

Status
Not open for further replies.

illini

Technical User
Aug 2, 2002
89
FR
I have a form which displays a record from a table. I would like to allow the user to delete this record from the table, but it has to be a deliberate action. Therefor, instead of using a Cmd_Button, I want the user to have to press the 'Ctrl' + 'Del' buttons at the same time. Excel will allow this using the OnKey procedure. For example...

Application.OnKey "{Ctrl} + {Del}", "del_record"

Does Access 2000 provide anything similar?

-illini
 
Hi!

Open up a new macro and click on the button to make the macro name column visible. In the macro name column put the desired key stroke or combination, in this case ^{DEL}. Finally fill in the action you want the macro to perform. When you save the macro call it autokeys.

hth
Jeff Bridgham
bridgham@purdue.edu
 
Jeff,

Thanks. I was able to get a test macro (with a msgbox) to work. However the '^{Del}' name would not work. I could only get it to work if I renamed it '{Del}'. Any ideas?

-illini
 
Hi!

What did you use for the action. I used RunCommand and then chose delete record in the box below and this worked fine for me.

hth
Jeff Bridgham
bridgham@purdue.edu
 
I used 'MsgBox' for the action -- just to test it out. The name in the Macro Name Column is '^{Del}'. When I press 'Ctrl' and 'Del' at the same time, nothing happened.

Now when I rename the name in the Macro Name Column to '{Del}' and press the 'Del' button, the msgbox appears as intended.

-illini
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top