By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,062 Members | 1,374 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,062 IT Pros & Developers. It's quick & easy.

Autokey Issues - Access 2000

P: 3
I am trying to find a way to disable my autokeys when I am in my login form. My problem is that when I open my login form, my users can still get out of it by pressing the autokeys. Is there a way that I can disable them in that form only?

Any help would be greatly appreciated.

Thanks.
Sep 11 '07 #1
Share this Question
Share on Google+
5 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
I am trying to find a way to disable my autokeys when I am in my login form. My problem is that when I open my login form, my users can still get out of it by pressing the autokeys. Is there a way that I can disable them in that form only?

Any help would be greatly appreciated.

Thanks.
What keys are you referring to exactly?
Sep 13 '07 #2

P: 6
I'm looking to do the same thing. I've set up a login screen but users can get around it to the functions by hitting F1, F2, F3, etc. I need to disable the F keys as soon as Access starts. Anyway to do it?

Sorry. To clarify, I'm running Access 2000.


What keys are you referring to exactly?
Dec 18 '07 #3

missinglinq
Expert 2.5K+
P: 3,532
Goto Properties - Events for your form and set Key Preview to Yes, the in the code module behind your login form:

Expand|Select|Wrap|Line Numbers
  1. Private Sub form_keydown(KeyCode As Integer, Shift As Integer)
  2. Dim NewRecHit As Long
  3.  
  4.     Select Case KeyCode
  5.  
  6.         Case vbKeyF2
  7.          KeyCode = 0
  8.  
  9.         Case vbKeyF3
  10.          KeyCode = 0
  11.  
  12.         Case vbKeyF4
  13.          KeyCode = 0        
  14.  
  15. Case Else
  16.  
  17. End Select
You can add as many more FKeys as you like in this manner. It's generally considered bad form to spike F1 (Help) but you can if you like. When moving to another form everything will be restored.

You can use this same technique to cancel the function of most keys as well as to change the function of keys, but always keep in mind the native purpose of the keys! Even if you don't use the normal functions of the keys, your users might!

Welcome to TheScripts!

Linq ;0)>
Dec 18 '07 #4

P: 6
Wicked! That's perfect. I discovered an autokeys macro that activates all the F keys for use in the rest of the database... but I was requested to add a login form and users could skip around it, so I wanted to make sure that they actually legitimately logged in before they could use the special functions.

Thank you so much for the help and the welcome! :-)


Goto Properties - Events for your form and set Key Preview to Yes, the in the code module behind your login form:

Expand|Select|Wrap|Line Numbers
  1. Private Sub form_keydown(KeyCode As Integer, Shift As Integer)
  2. Dim NewRecHit As Long
  3.  
  4.     Select Case KeyCode
  5.  
  6.         Case vbKeyF2
  7.          KeyCode = 0
  8.  
  9.         Case vbKeyF3
  10.          KeyCode = 0
  11.  
  12.         Case vbKeyF4
  13.          KeyCode = 0        
  14.  
  15. Case Else
  16.  
  17. End Select
You can add as many more FKeys as you like in this manner. It's generally considered bad form to spike F1 (Help) but you can if you like. When moving to another form everything will be restored.

You can use this same technique to cancel the function of most keys as well as to change the function of keys, but always keep in mind the native purpose of the keys! Even if you don't use the normal functions of the keys, your users might!

Welcome to TheScripts!

Linq ;0)>
Dec 18 '07 #5

missinglinq
Expert 2.5K+
P: 3,532
Glad we could help, Mackabee!

Linq ;0)>
Dec 18 '07 #6

Post your reply

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