User defined auto keys

  • Thread starter Thread starter Vensia
  • Start date Start date
V

Vensia

Dear All,

In my application, there is an auto key to open a form. But I want the user
can define their own key to open the form.
The user defined combination keys will be saved in the table. How should I
write the code ?
Thanks before.

Regards,
Vensia
 
Vensia,

You can make a macro and name it AutoKeys, and then use this to define
actions for various keys and key combinations. I think the Access Help
on this topic is very good.
 
The problem is I want the user can change the key I have defined with their
own key, ie. I defined ALT+C to open a form, then the user can change ALT+C
with their own key (ie. ALT+W). There will be a form for user to setup their
own key.
I want to know how I can activate the user-defined key to open the form ?
Thx.

Vensia
 
Vensia,

I think you could write a user-defined function which could be run on
the form's Key Press event. This would be rather complex, as you would
need to allow for single keys and key combinations (but only allowable
key combinations), and read these as variables based on the table
entries. FWIW, I would strongly discourage any user who asked me for
this functionality!
 
The problem is I want the user can change the key I have defined with their
own key, ie. I defined ALT+C to open a form, then the user can change ALT+C
with their own key (ie. ALT+W). There will be a form for user to setup their
own key.
I want to know how I can activate the user-defined key to open the form ?
Thx.

Vensia
 
Vensia,

I think you could write a user-defined function which could be run on
the form's Key Press event. This would be rather complex, as you would
need to allow for single keys and key combinations (but only allowable
key combinations), and read these as variables based on the table
entries. FWIW, I would strongly discourage any user who asked me for
this functionality!
 
Dear Steve,

I'm really don't know how to trap the key combination in KeyDown. I just
know to trap single key like below :

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = Key112 Then
msgbox "Help"
End If
End Sub

The problem is that the key combination is stored in a table. After access
the table and stores the column table value in a variable, then the variable
is passed as the parameter to KeyCode. Anyone can help me ? Please...
 
Vensia,

Hope this might help point you in the direcion of a workable solution...

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyT And Shift = acCtrlMask Then
MsgBox "You have pressed Ctrl+T"
End If
End Sub
 
Back
Top