Zoom Box command button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'd like to create a command button that acts as a Shift+F2 function (zoom
box). The button needs to be linked to a specifix text box control.

Any ways to do this in VBA?

Thanks.
 
In the dbl-click event of the control you want to zoom:

DoCmd.RunCommand acCmdZoomBox

When someone double clicks in the control, the zoom box will open.
 
In
Gaetan said:
I'd like to create a command button that acts as a Shift+F2 function
(zoom box). The button needs to be linked to a specifix text box
control.

Any ways to do this in VBA?

Although I would normally do this the way Pat Hartman suggests, and use
the text box's DblClick event, if you really want it to be triggered by
a button, you can do it like this:

Private Sub cmdZoom_Click()

Me!txtYourTextbox.SetFocus
RunCommand acCmdZoomBox

End Sub

Alternatively, you could have the button zoom whatever control
previously had the focus, like this:

On Error ResumeNext
Screen.PreviousControl.SetFocus
RunCommand acCmdZoomBox
 
That works great! Exactly what I needed.... Thanks Dirk.

Thanks to Pat for his alternative.
 
Hi there!
Tried suggested solution, worked perfect.
Well, allmost. The problem is now that the button used to zoom keeps looking
like it has focus. I have the buttons on the details section of a continous
form, and when I haven't clicked yet, the buttons each become yellow-edged
when I mouse-over them. When I click, the text-field next to it gets focus
and opens the zoombox.
When I close this zoombox, *all* the buttons next to all the textfields now
have this "mouse-over" look (orange-yellow edged).
How do I bring this buttons back to default state?
Tried with repaint, didn't work. Is there a "loose-focus" like there is a
"setfocus"?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

IPad remote 10
Configuring the ACCESS Zoom Box 4
ability to open zoom box features 2
Zoom box end of text 1
Zoom Box Font 2
Memo Zoom Box Trigger 3
Memo Zoom Box 1
Zoom form from Double-Click 2

Back
Top