Solved

Zoom box macro

Posted on 2016-09-16
10
54 Views
Last Modified: 2016-09-17
Experts, I need a macro for the zoom box.  I cant seem to get it right.  How to convert the below to a macro?  

Private Sub Purpose_DblClick(Cancel As Integer)

    DoCmd.RunCommand acCmdZoomBox
   
End Sub
0
Comment
Question by:pdvsa
[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
  • 4
  • 2
  • 2
  • +1
10 Comments
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 41801676
That works for me -- it should work for you, assuming that Purpose is the name of a textbox (it is best to give controls the appropriate prefixes, to avoid confusion with their bound fields).  Here is the code I made, and the Zoom box pops up when I double-click in the textbox:

Private Sub txtPurpose_DblClick(Cancel As Integer)

   DoCmd.RunCommand acCmdZoomBox

End Sub

Open in new window


Occasionally, event procedures get detached from their controls, so check that you can open the procedure from the control's property sheet.
0
 

Author Comment

by:pdvsa
ID: 41801709
Hi Helen, yes, it does work for me as well however I want to be able to choose this in a macro instead of writing the code each time.
0
 
LVL 31

Accepted Solution

by:
Helen_Feddema earned 500 total points
ID: 41801749
In that case, make a public function in a standard module:

Public Function ZoomBox()

   DoCmd.RunCommand acCmdZoomBox
   
End Function

Open in new window

and a macro that calls it with the RunCode macro action, which you can then attach to the DblClick event of many controls.

Zoom macro
0
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.

 

Author Closing Comment

by:pdvsa
ID: 41801761
Perfect.  thank you.
0
 
LVL 8

Expert Comment

by:Anders Ebro (Microsoft MVP)
ID: 41801764
Note that you could instruct your users to use Shift-F2, which is the keyboard shortcut to trigger the Zoombox.
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 41801786
That is true, though Shift-F2 doesn't work currently on my computer (I think it is a hardware issue with the keyboard).  There are usually two or three different ways to do anything in Access.
0
 
LVL 75
ID: 41801888
Interesting .... I've never seen Shift+F2 not work.
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 41801952
F2 alone doesn't work either (for opening the Object Browser).
0
 
LVL 8

Expert Comment

by:Anders Ebro (Microsoft MVP)
ID: 41802968
Helen, it sounds like you have disabled Access Special Keys in your database. You will find this setting under "Options"->Current Database.
0
 
LVL 75
ID: 41803168
Ahh ... that could be it Anders. In fact, that somehow happened to me a while back.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

738 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