Autokeys?

deejay_totoro

Registered User.
Local time
Today, 22:41
Joined
May 29, 2003
Messages
169
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..
Code:
DoCmd.RunCommand acCmdZoomBox
or if you really want a button, this in the OnClick event...
Code:
Me.YourTextBox.SetFocus
DoCmd.RunCommand acCmdZoomBox
and in the OnClick event of the spell check button
Code:
DoCmd.RunCommand acCmdSpelling

IMO
 
Last edited:
Currently selected text box?

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
 
Re: Currently selected text box?

deejay_totoro said:

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...
Code:
Private Sub YourTextBox_DblClick(Cancel As Integer)

   DoCmd.RunCommand acCmdZoomBox

End Sub
this will then only zoom for that text box.

HTH
 

Users who are viewing this thread

Back
Top Bottom