Can't disable the active control...
I have a form with buttons that I'd like to disable after they are pushed, like the save and the undo buttons, and then re-enable them after the data on the form is changed. When the user pushes either of these buttons, they receive the focus so I can't diable them while they have the focus. Instead of just sending the focus back to the first data field control, I implemented a "last active control" mechanism using a global variable of control type and the exit event's of the data entry fields.
When either of these buttons is pushed, I'm sending the focus back to the control stored in the global variable with the statement:
Last_Active_Control.setfocus
This works well most of the time, but sometimes I am told that the assignment isn't valid, especially during debugging. Is there a way to check that the global variable has been assigned a valid control before making the trying to use it to set the focus?
Unfortunately, there doesn't seem to be an IsControl test in Access 2000's vba.
Thank you.
|