Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-08-14
2
Medium Priority
?
1,725 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 255 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

783 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