Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
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…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

730 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