Re: Retrieve selected field name



Did you read everything I posted?

Create a generic Got Focus function that's called from every appropriate
control, and another generic Lost Focus function that's also called from
every appropriate control.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"ainow" <ainow@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9F30A351-C7CC-44F9-A729-8990A3AAF3D7@xxxxxxxxxxxxxxxx
Doug

First, the reason I want the event is because I use the same procedure to
undo any changes to the field when it loses focus by reading the third
parameter passed to setFieldColorsEffect. Remember the idea here is be
able
to paste Call setFieldColorsEffect(Me, Screen.ActiveControl.Name, returned
action) into a got or lost focus event without any modifications.

Screen.ActiveControl.Name worked except for one problem. The first field
in
the tab order is ptCategory, therefore it is hit before the screen is
visible
which generates an error:

Run-time error '2474'
The expression you entered requires the control to be in the active
window.

By setting a button for the tab index of 1 corrects the problem but is not
user friendly.



.


Loading