Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 75
  • Last Modified:

Zoom box macro

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
pdvsa
Asked:
pdvsa
  • 4
  • 2
  • 2
  • +1
1 Solution
 
Helen FeddemaCommented:
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
 
pdvsaProject financeAuthor Commented:
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
 
Helen FeddemaCommented:
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
Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

 
pdvsaProject financeAuthor Commented:
Perfect.  thank you.
0
 
Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
Note that you could instruct your users to use Shift-F2, which is the keyboard shortcut to trigger the Zoombox.
0
 
Helen FeddemaCommented:
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
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Interesting .... I've never seen Shift+F2 not work.
0
 
Helen FeddemaCommented:
F2 alone doesn't work either (for opening the Object Browser).
0
 
Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
Helen, it sounds like you have disabled Access Special Keys in your database. You will find this setting under "Options"->Current Database.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Ahh ... that could be it Anders. In fact, that somehow happened to me a while back.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now