Privateer
Registered User.
- Local time
- Today, 07:35
- Joined
- Aug 16, 2011
- Messages
- 193
After compacting and repairing the db, (W10-Office 365), closing and opening it, seven command buttons fail their respective on click event. Two buttons created recently, and on the same form, work as expected. So, I open VBA and open the class module for that form ("frmAdmin"), click on any of the seven that failed, and they work. Close the class object, but leave VBA open, and the buttons fail again, open the class object and the buttons work. The error message is Error 91, Object variable or With block variable is not set, which isn't much help as six to twelve procedures run behind any one of these seven buttons with no errors. Additionally, the Event Procedure is in the On Click field.
I have deleted one of the seven and created it from scratch, thinking the newly created buttons don't have this problem. I changed the name of the button and created a brand new on click event into which I copied the code. I confirmed the link to the on click event in the procedure and everything worked fine. However, after C&R, close, open, buttons fail. The form will open, but that class object must be open for the code to work.
I put a stop execution on a procedure in the form load event and closed the module, then the form. Opening the form caused to module to open on the stopped line, so the link between the form and the module is working, and this allowed the command buttons to work. I tried this because the form and the module act as if they are not joined to each other properly.
I did some research and decided to import the form into another Access database, created on the same laptop three weeks ago. I ran into some reference problems and added in Excel 16 and Office 16 objects to get the module to compile, which it evidentially did. Buttons still would not work unless the class module was opened. Very frustrating, never seen this in 25 years.
I am trying to deliver this front end to co-workers, and I can't have this loss of function simply because the class module, and VBA are closed. Any help on this abnormal behavior would be greatly appreciated.
I have deleted one of the seven and created it from scratch, thinking the newly created buttons don't have this problem. I changed the name of the button and created a brand new on click event into which I copied the code. I confirmed the link to the on click event in the procedure and everything worked fine. However, after C&R, close, open, buttons fail. The form will open, but that class object must be open for the code to work.
I put a stop execution on a procedure in the form load event and closed the module, then the form. Opening the form caused to module to open on the stopped line, so the link between the form and the module is working, and this allowed the command buttons to work. I tried this because the form and the module act as if they are not joined to each other properly.
I did some research and decided to import the form into another Access database, created on the same laptop three weeks ago. I ran into some reference problems and added in Excel 16 and Office 16 objects to get the module to compile, which it evidentially did. Buttons still would not work unless the class module was opened. Very frustrating, never seen this in 25 years.
I am trying to deliver this front end to co-workers, and I can't have this loss of function simply because the class module, and VBA are closed. Any help on this abnormal behavior would be greatly appreciated.
Last edited: