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

x
?
Solved

Zoom box macro

Posted on 2016-09-16
10
Medium Priority
?
63 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 2000 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Closing Comment

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

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 9

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

721 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