PC Review


Reply
Thread Tools Rate Thread

Disable All Shortcut Keys - In Access 97

 
 
Jado
Guest
Posts: n/a
 
      3rd Jun 2004
Hi

I have a form that opens with a database, and when the from is closed, it
automatically exits the database. This keeps the users away from the
underling tables queries and code.

but if a user knows how, or hits a set of keys by mistake, it is possible to
bring up the database window along with a load of other undesired shortcut
features.

Probably the most worrying is Ctrl+A (Select All) which actually selects
every record in the underlying recordset. if a user then presses another
key, the database tries to delete all records (which are unrecoverable).
This has never happened, but I'd like to prevent it before it dose.

Is it possible to disable these types of shortcut keys.

I'd like to leave Cut, Copy, Paste shortcuts working if possible.


Thanks

Jado


 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      3rd Jun 2004
A simple way to disable a keystroke application wide is to reassign it to
something innocuous.

1. Create a new macro.

2. If you do not see a Macro Names column, choose Macro Names on the View
menu.

3. In the Macro Name column, enter:
^A
(Note: Use Shift+6 to get the caret character.)

4. In the Action column, choose an action such as:
Beep

5. Save the macro with the name:
AutoKeys
The correct name is important.

Now whenever the user presses Ctrl+A, the computer beeps and does not select
all records.

If you just wanted to do that for one form, you could turn on the form's
KeyPreview property, and use the KeyPress event to set KeyAscii to 0.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jado" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> I have a form that opens with a database, and when the from is closed, it
> automatically exits the database. This keeps the users away from the
> underling tables queries and code.
>
> but if a user knows how, or hits a set of keys by mistake, it is possible

to
> bring up the database window along with a load of other undesired shortcut
> features.
>
> Probably the most worrying is Ctrl+A (Select All) which actually selects
> every record in the underlying recordset. if a user then presses another
> key, the database tries to delete all records (which are unrecoverable).
> This has never happened, but I'd like to prevent it before it dose.
>
> Is it possible to disable these types of shortcut keys.
>
> I'd like to leave Cut, Copy, Paste shortcuts working if possible.



 
Reply With Quote
 
Jado
Guest
Posts: n/a
 
      3rd Jun 2004
Thanks Allen

Do you know of a source that lists all default shortcut keys in Access 97 /
Win2000?

in the mean time i'll take a look on the internet.

also, do you know if there's a VBA equivillent of AutoKeys. I would rarther
use this feature in startup code. That way i could set limitations based on
current user. i'll try converting the macro to code and see what happens!

i don't fully understand the last part of your reply

> If you just wanted to do that for one form, you could turn on the form's
> KeyPreview property, and use the KeyPress event to set KeyAscii to 0.


what would this do?

Thanks Again

Jado


"Allen Browne" <(E-Mail Removed)> wrote in message
news:ep%23%(E-Mail Removed)...
> A simple way to disable a keystroke application wide is to reassign it to
> something innocuous.
>
> 1. Create a new macro.
>
> 2. If you do not see a Macro Names column, choose Macro Names on the View
> menu.
>
> 3. In the Macro Name column, enter:
> ^A
> (Note: Use Shift+6 to get the caret character.)
>
> 4. In the Action column, choose an action such as:
> Beep
>
> 5. Save the macro with the name:
> AutoKeys
> The correct name is important.
>
> Now whenever the user presses Ctrl+A, the computer beeps and does not

select
> all records.
>
> If you just wanted to do that for one form, you could turn on the form's
> KeyPreview property, and use the KeyPress event to set KeyAscii to 0.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Jado" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >
> > I have a form that opens with a database, and when the from is closed,

it
> > automatically exits the database. This keeps the users away from the
> > underling tables queries and code.
> >
> > but if a user knows how, or hits a set of keys by mistake, it is

possible
> to
> > bring up the database window along with a load of other undesired

shortcut
> > features.
> >
> > Probably the most worrying is Ctrl+A (Select All) which actually selects
> > every record in the underlying recordset. if a user then presses

another
> > key, the database tries to delete all records (which are unrecoverable).
> > This has never happened, but I'd like to prevent it before it dose.
> >
> > Is it possible to disable these types of shortcut keys.
> >
> > I'd like to leave Cut, Copy, Paste shortcuts working if possible.

>
>



 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      3rd Jun 2004
You can trap the keystrokes in a form. Use the form's KeyPress event if you
are interested in the charater, or KeyDown event to trap non-character
strokes such as PgDn or Del. By setting the argument to zero in the event,
you destroy the keystroke before it is processed.

This example stops the Esc key from undoing a form or its controls:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then
KeyCode = 0
End If
End Sub


(Don't forget to turn on the form's KeyPreview property.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jado" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks Allen
>
> Do you know of a source that lists all default shortcut keys in Access 97

/
> Win2000?
>
> in the mean time i'll take a look on the internet.
>
> also, do you know if there's a VBA equivillent of AutoKeys. I would

rarther
> use this feature in startup code. That way i could set limitations based

on
> current user. i'll try converting the macro to code and see what happens!
>
> i don't fully understand the last part of your reply
>
> > If you just wanted to do that for one form, you could turn on the form's
> > KeyPreview property, and use the KeyPress event to set KeyAscii to 0.

>
> what would this do?
>
> Thanks Again
>
> Jado
>
>
> "Allen Browne" <(E-Mail Removed)> wrote in message
> news:ep%23%(E-Mail Removed)...
> > A simple way to disable a keystroke application wide is to reassign it

to
> > something innocuous.
> >
> > 1. Create a new macro.
> >
> > 2. If you do not see a Macro Names column, choose Macro Names on the

View
> > menu.
> >
> > 3. In the Macro Name column, enter:
> > ^A
> > (Note: Use Shift+6 to get the caret character.)
> >
> > 4. In the Action column, choose an action such as:
> > Beep
> >
> > 5. Save the macro with the name:
> > AutoKeys
> > The correct name is important.
> >
> > Now whenever the user presses Ctrl+A, the computer beeps and does not

> select
> > all records.
> >
> > If you just wanted to do that for one form, you could turn on the form's
> > KeyPreview property, and use the KeyPress event to set KeyAscii to 0.
> >
> >
> > "Jado" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > >
> > > I have a form that opens with a database, and when the from is closed,

> it
> > > automatically exits the database. This keeps the users away from the
> > > underling tables queries and code.
> > >
> > > but if a user knows how, or hits a set of keys by mistake, it is

> possible
> > to
> > > bring up the database window along with a load of other undesired

> shortcut
> > > features.
> > >
> > > Probably the most worrying is Ctrl+A (Select All) which actually

selects
> > > every record in the underlying recordset. if a user then presses

> another
> > > key, the database tries to delete all records (which are

unrecoverable).
> > > This has never happened, but I'd like to prevent it before it dose.
> > >
> > > Is it possible to disable these types of shortcut keys.
> > >
> > > I'd like to leave Cut, Copy, Paste shortcuts working if possible.



 
Reply With Quote
 
Jado
Guest
Posts: n/a
 
      8th Jun 2004
That's alot clearer

Thanks Allen

Jado

"Allen Browne" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You can trap the keystrokes in a form. Use the form's KeyPress event if

you
> are interested in the charater, or KeyDown event to trap non-character
> strokes such as PgDn or Del. By setting the argument to zero in the event,
> you destroy the keystroke before it is processed.
>
> This example stops the Esc key from undoing a form or its controls:
>
> Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
> If KeyCode = 27 Then
> KeyCode = 0
> End If
> End Sub
>
>
> (Don't forget to turn on the form's KeyPreview property.)
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Jado" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Thanks Allen
> >
> > Do you know of a source that lists all default shortcut keys in Access

97
> /
> > Win2000?
> >
> > in the mean time i'll take a look on the internet.
> >
> > also, do you know if there's a VBA equivillent of AutoKeys. I would

> rarther
> > use this feature in startup code. That way i could set limitations

based
> on
> > current user. i'll try converting the macro to code and see what

happens!
> >
> > i don't fully understand the last part of your reply
> >
> > > If you just wanted to do that for one form, you could turn on the

form's
> > > KeyPreview property, and use the KeyPress event to set KeyAscii to 0.

> >
> > what would this do?
> >
> > Thanks Again
> >
> > Jado
> >
> >
> > "Allen Browne" <(E-Mail Removed)> wrote in message
> > news:ep%23%(E-Mail Removed)...
> > > A simple way to disable a keystroke application wide is to reassign it

> to
> > > something innocuous.
> > >
> > > 1. Create a new macro.
> > >
> > > 2. If you do not see a Macro Names column, choose Macro Names on the

> View
> > > menu.
> > >
> > > 3. In the Macro Name column, enter:
> > > ^A
> > > (Note: Use Shift+6 to get the caret character.)
> > >
> > > 4. In the Action column, choose an action such as:
> > > Beep
> > >
> > > 5. Save the macro with the name:
> > > AutoKeys
> > > The correct name is important.
> > >
> > > Now whenever the user presses Ctrl+A, the computer beeps and does not

> > select
> > > all records.
> > >
> > > If you just wanted to do that for one form, you could turn on the

form's
> > > KeyPreview property, and use the KeyPress event to set KeyAscii to 0.
> > >
> > >
> > > "Jado" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > >
> > > > I have a form that opens with a database, and when the from is

closed,
> > it
> > > > automatically exits the database. This keeps the users away from

the
> > > > underling tables queries and code.
> > > >
> > > > but if a user knows how, or hits a set of keys by mistake, it is

> > possible
> > > to
> > > > bring up the database window along with a load of other undesired

> > shortcut
> > > > features.
> > > >
> > > > Probably the most worrying is Ctrl+A (Select All) which actually

> selects
> > > > every record in the underlying recordset. if a user then presses

> > another
> > > > key, the database tries to delete all records (which are

> unrecoverable).
> > > > This has never happened, but I'd like to prevent it before it dose.
> > > >
> > > > Is it possible to disable these types of shortcut keys.
> > > >
> > > > I'd like to leave Cut, Copy, Paste shortcuts working if possible.

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
disable shortcut keys =?Utf-8?B?Q2hyaXMgV2lsa2luc29u?= Microsoft Excel Programming 1 7th Jun 2007 06:38 PM
disable alt and control shortcut keys jhahes Microsoft Excel Programming 1 15th Aug 2006 04:16 AM
Disable shortcut keys =?Utf-8?B?Sg==?= Windows XP General 1 29th Mar 2006 05:59 PM
Disable Shortcut Keys Ronbo Microsoft Excel Programming 1 25th May 2004 03:12 PM
IE shortcut keys..disable jessica Windows XP Internet Explorer 1 25th Mar 2004 07:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:57 PM.