Solved

assign F1....F12 function key as a shortcuts,is it possible??

Posted on 2004-08-14
2
1,710 Views
Last Modified: 2008-01-09
hello all
this time I have a question about assigning F1......F12 key function as a shortcut instead of normal shortcuts((((((((Alt+anykey)))))))))) ,I understand that this those keys have their own functions in MSAccess but is there anycode or something to stop their functions and edit them or assign them to do another thing such : open,delete,insert,search as any other botton????????

your help will be appriciated,
thankx alot my dears
 
0
Comment
Question by:wellous
2 Comments
 
LVL 36

Accepted Solution

by:
SidFishes earned 85 total points
ID: 11802061
here's a function to set up hotkeys

all you need to do is

Public Function HotKeys(KeyCode As Integer, Shift As Integer, callerForm As String)

Dim intkey As Integer
intkey = KeyCode
KeyCode = 0 'assumption is first made that user-operation key was pressed, therefore keystroke is neutralized.
'If not a user-operational key, then original value will be restored below

Select Case intkey 'check to see if key pressed was an operational key

Case is = 17 'just add case stmts based on the key code values of your fkeys
                   ' you can trap almost any key or combination
end select

End If

Case Else 'key pressed was not an operational key, so reassign original value for data entry
    GoTo abort
End Select
exitsub:
Exit Function

abort:     'see Case Else above
KeyCode = intkey
End Function


then on your form

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

    HotKeys KeyCode, 0

End Sub
0
 
LVL 5

Author Comment

by:wellous
ID: 11812594
hello sidfishes

I found the answer at the internet and between your lines,and here it is


Private Sub Form_Load()
Me.KeyPreview = True

End Sub

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

Select Case KeyCode
Case vbKeyF2
DoCmd.OpenForm "............fomname,,,,"
Case vbKeyF3
DoCmd.OpenForm "formname,,,."
Case Else
End Select
End Sub
-----------------------------------------------------


thats all

anyway thankx alot my dear
I was helped by you
your points in your way
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now