Solved

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

Posted on 2004-08-14
2
1,721 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

630 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