SendKeys in Access2003 and Vista

  • Thread starter Thread starter AnyOne
  • Start date Start date
A

AnyOne

Hi,

We have had another Vista 'problem' popup. It is related to Vista security
settings.

We use the `SendKeys` function in the `BeforeUpdate` event if sine controls
to send the `Esc` key and clear an invalid entry from a text box, check box,
etc. The `Undo` method works on bound controls, but on unbound controls the
`Undo` method does not do anything and `SendKeys` is the best we have been
able to find. Vista apparently blocks programmatic keyboard actions (makes
some sense), so now these `BeforeUpdate` functions generate an error and
create a confusing user situation. We have tried numerous local policy
settings changes, but the only thing that works is turning off User Account
Control. Seems a little drastic.

Any ideas for replacing `SendKeys` or getting around Vista security without
disabling UAC? Any suggestions greatly appreciated.
 
Hi,

We have had another Vista 'problem' popup. It is related to Vista security
settings.

We use the `SendKeys` function in the `BeforeUpdate` event if sine controls
to send the `Esc` key and clear an invalid entry from a text box, check box,
etc. The `Undo` method works on bound controls, but on unbound controls the
`Undo` method does not do anything and `SendKeys` is the best we have been
able to find. Vista apparently blocks programmatic keyboard actions (makes
some sense), so now these `BeforeUpdate` functions generate an error and
create a confusing user situation. We have tried numerous local policy
settings changes, but the only thing that works is turning off User Account
Control. Seems a little drastic.

Any ideas for replacing `SendKeys` or getting around Vista security without
disabling UAC? Any suggestions greatly appreciated.

We've written a lot of Access applications and we have never used
SendKeys. They are just too problematic; it's worth finding another
way.

In this particular case, can't you just clear out the value of the
control? Or if you need to reset it to previous value, remember it
upon entering the field, and then set it back.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
Thanks for your reply. Can't just clear the variable value. It generates
an error in BeforeUpdate. We are going to use something similar to your
second suggestion, but we have to let it go until AfterUpdate. Too bad,
SendKeys was so simple. This was the only place we used it until Vista.
 
Back
Top