Shortcut key problem

  • Thread starter Thread starter Vensia
  • Start date Start date
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top