Shortcut key problem

V

Vensia

Dear all,

I have a secret shortcut key which opens an entry form. I want the users are
able to change this shortcut key with their own key. If the shortcut key
definition is saved in a table, how do I call it programmatically ?
Thanks.

Vensia
 
M

Michel Walsh

Hi,


If the active form has the preview key on, a possible solution is to use a
DLookup or DCount from the KeyDown event of the form:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If 0 = DCount("*", "tableName", "Shift=" & Shift & " AND Keycode=" &
KeyCode) Then
DoCmd.OpenForm ...
End If

End Sub


Assuming the mentioned table is "local" (in the front end, NOT in the back
end), no need to test for the user id. I assume the table has the two fields
Shift and KeyCode. You could also use database properties, instead of a
local table, since there is likely just one "combination" to store.



Hoping it may help,
Vanderghast, Access MVP
 
Top