Solved

Zoom box macro

Posted on 2016-09-16
10
45 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
  • 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Closing Comment

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

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 7

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of utilizing SQL Server views 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 Microsoft Access…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

830 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