What is the VBA code for Zoom or Shift F2?

  • Thread starter Thread starter M Skabialka
  • Start date Start date
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
 
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
 
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
 
Back
Top