I have an application that was originally written in Access 2000 but which was recently converted to Access 2002, at the same time as the client upgraded from Windows 2000 to Windows XP.
The application has run fine on Access 2000 for several years. The client is now getting an intermittent error with the newly converted Access 2002 version.
I took a look at the error today and it looks like it's tied to the AfterUpdate property of one of the controls. The AfterUpdate event is set to be a procedure, and 99% of the time this procedure is what gets called. When this happens there is no error. But occasionally the application gets "stuck" on the control. The control will not give up focus, and thus the application appears to have died since no other control can get the focus. (The client probably hits these controls hundreds or thousands of times a day. The error in question comes up only once or twice a day, usually when there are multiple clicks in succession on the problematic control.)
As far as I can tell, the focus appears to get stuck on the control because the AfterUpdate property gets changed by Access internally from the proper [Event Procedure] to an arbitrary macro, and the macro in question tries to set focus somewhere on the form where focus can't be set.
I guess I can do something with error-handling to catch the exception and handle it properly, but I'm a bit worried that this is happening at all. The application was fine for several years on 2000, and now they're getting screwy things as soon as they move to 2002.
The application has been run both as an Access 2000 database under Access 2002, and as a converted Access 2002 application. Error occurs both times. The code in the application is fully compiled.
Does anyone have any ideas about what's causing Access 2002 to reassign the AfterUpdate event handler? Any ideas on how to avoid it?
Thanks,
Herb
The application has run fine on Access 2000 for several years. The client is now getting an intermittent error with the newly converted Access 2002 version.
I took a look at the error today and it looks like it's tied to the AfterUpdate property of one of the controls. The AfterUpdate event is set to be a procedure, and 99% of the time this procedure is what gets called. When this happens there is no error. But occasionally the application gets "stuck" on the control. The control will not give up focus, and thus the application appears to have died since no other control can get the focus. (The client probably hits these controls hundreds or thousands of times a day. The error in question comes up only once or twice a day, usually when there are multiple clicks in succession on the problematic control.)
As far as I can tell, the focus appears to get stuck on the control because the AfterUpdate property gets changed by Access internally from the proper [Event Procedure] to an arbitrary macro, and the macro in question tries to set focus somewhere on the form where focus can't be set.
I guess I can do something with error-handling to catch the exception and handle it properly, but I'm a bit worried that this is happening at all. The application was fine for several years on 2000, and now they're getting screwy things as soon as they move to 2002.
The application has been run both as an Access 2000 database under Access 2002, and as a converted Access 2002 application. Error occurs both times. The code in the application is fully compiled.
Does anyone have any ideas about what's causing Access 2002 to reassign the AfterUpdate event handler? Any ideas on how to avoid it?
Thanks,
Herb