Solved

ADDING HOT KEY F4 TO A FORM THAT OPENS ANOTHER FORM

Posted on 2001-06-26
7
358 Views
Last Modified: 2012-06-27
How do I add the ability from a certain form that if the user clicks F4 on that form does a DoCmd.OpenForm event?  Thanks
0
Comment
Question by:bostonroxx
7 Comments
 
LVL 1

Expert Comment

by:loosegroove
ID: 6229065
Create a new Macro and name it "AutoKeys".  Then in the new Macro click the Macro Names command bar button to shows the names for the Macros.  Under the Macro Name column enter {F4}.  Under the Action column choose Open Form.  Under the properties below choose the form you wish to open. Save the macro.

Now, everytime you press F4 the form you specified will open.

good luck,

Bronson C. Elliott
0
 
LVL 11

Accepted Solution

by:
LambertHeenan earned 50 total points
ID: 6229169
In the form that you want to be responsive to F4 (the "host form") set it's KeyPreview property to "Yes" (it's on the Event tab of the form property sheet) and then a simple KeyUp event for the host form will do what you need.

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = 115 And Shift = 0 Then
    ' KeyCode 115 = F4 key pressed
         DoCmd.OpenForm "YourFormName"
    End If
End Sub
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6278093
Hi bostonroxx,

u been asking 8 Q's in 10 days, and have not graded 1.
Didn't anyone provide a correct comment?

u should follow up on your Q's. Experts put in time and effort for u, u know!

cheers
Ricky
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

by:bostonroxx
ID: 6291799
Just feel like giving you the points and not Paurths.  Thanks man
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6291821
ofcourse u dont have to give them to me, i did not participate in this thread... (thats obvious)

cheers
Ricky
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6291836
0
 
LVL 12

Expert Comment

by:Paurths
ID: 6291866
i would like to ask all other experts participating in this thread to take a look : http://www.experts-exchange.com/jsp/qShow.jsp?ta=msaccess&qid=20144772
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

820 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