deejay_totoro
10-01-2003, 08:13 AM
Hello all,
I have created a button, from which I would like to run a Macro when clicked.
The action is the SendKeys action. However, the problem is this:
I would like to create two buttons, one for the Zoom (Shift + F2) and one for the Spell Checker (F7).
However, the Keystrokes property will not allow me to define such combination of keys.
How might I go about this?
Any help greatly appreciated!
Many thanks,
dj_T
In the DoubleClick event of the field you want to Zoom..
DoCmd.RunCommand acCmdZoomBox
or if you really want a button, this in the OnClick event...
Me.YourTextBox.SetFocus
DoCmd.RunCommand acCmdZoomBox
and in the OnClick event of the spell check button
DoCmd.RunCommand acCmdSpelling
IMO
deejay_totoro
10-03-2003, 05:21 AM
Hello and thank you.
This works fine - however, here are some queries I have:
1: The spell check button works. However, it checks not only everything on the current form - but the entire database. How can I limit the spell check to the currently selected text box? I tired using:
Me.TextField.SetFocus
DoCmd.RunCommand acCmdSpelling
but still continues on.
2: This also applies to the Zoom command. Apart from making two buttons (each referring to a different TextField), how can I zoom only the current text field?
Thank you very much.
Regards,
dj_T
Originally posted by deejay_totoro
1: The spell check button works. However, it checks not only everything on the current form - but the entire database. How can I limit the spell check to the currently selected text box?
2: This also applies to the Zoom command. Apart from making two buttons (each referring to a different TextField), how can I zoom only the current text field?
I'm not sure how, or even if it is possible to restrict the spell checker. Sorry.
Rather than creating buttons for the zoom, place the code in the double click event of the text box...
Private Sub YourTextBox_DblClick(Cancel As Integer)
DoCmd.RunCommand acCmdZoomBox
End Sub
this will then only zoom for that text box.
HTH