What is the VBA code for Zoom or Shift F2?

M

M Skabialka

I have a form with several memo boxes where users write long-winded
statements. In order to fit them all on the form I use a scroll bar on the
right so you can see about 5 lines for each field. I know you can choose
Shift F2 when in one of these fields to get a zoom box but I'd rather the
users not mess with function keys and wind up looking at tables or
something....

So, I'd like to add a button with a magnifying glass on it and code it to
open a zoom window for each of the memo fields.

Can someone please tell me what code would open a zoom window for a
particular field? I know how to add buttons, just need the code...

Thanks,
Mich
 
A

Allen Browne

When the button is clicked, the button has focus, so you will need to move
back to the previous control because you can't zoom on a command button:
Dim ctl As Control
Set ctl = Screen.PreviousControl
If ctl.ControlType = acTextBox Then
RunCommand acCmdZoomBox
Else
'what do you want to do?
End If
Set ctl = Nothing
 
M

M Skabialka

I ended up using a SendKeys statement, after setting focus to the field,
using the magnifying glass.
But I will probably use DoCmd.RunCommand acCmdZoomBox in the future..
Thanks,
Mich
 

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

Zoom (Shift F2) +{F2} 3
Is a ZOOM feeture available in a form? 2
Zooming memo field in single form view 5
Shift-F2 2
Memo Zoom Box Trigger 3
Zoom form from Double-Click 2
magnify field 1
Field Zoom Replacement 10

Top