I submitted this via the web site last night, but it hasn’t shown up all night, so here goes again. _ So, I start out with a form that works as far as it goes, but does not yet have the full functionality it needs. It has a brief On Current event handler, but no BeforeUpdate handler. I then add the Before Update handler, debug that through a couple of rounds … code mostly copied from another working form with a few adaptations. Part of this requires a small mod to On Current to add two captures of pre-change values into global variables so that these can be restored if there is a conflict detected with the new values, just like the working form. During the debugging, no issues are raised about On Current, even though, of course, it is going to fire before Before Update. _ Then I get the Before Update stuff working and all of a sudden I start getting this error message about On Current. I go so far as to put in msgboxs to test the place in On Current, since it isn’t giving me that, and then even comment out the entire contents of On Current, leaving only the header and the exit sub. Same message. I have no clue as to what it is trying to tell me. Oh, and I also removed the reference in the form to the event procedure (the error went away) and put it back (the error returned). Clicking the … button in the property sheet takes me to my now commented out procedure. _ The error message is: The expression On Current you entered as the event property setting produced the following error: A problem occurred while Author Software was communicating with the OLE Server or ActiveX Control. * The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure] * There may have been an error evaluating the function, event, or macro. This error occurs when an event has failed to run because Microsoft Office Access cannot evaluate the location of the logic for the event. For example, if the OnOpen property of a form is set to = [Field], this error occurs because Access expects a macro or event name to run when the event is fired. _ But, as noted, the event procedure does exist and it was perfectly happy with it previously. If I click the … in design view, I am taken to that procedure. The entire contents of the procedure are commented out, so there can’t be any errors in it and before I did that, I wasn’t getting the diagnostic message box which was the first statement. I have done compact and repair. I have closed and opened the database a couple of times. I have rebooted Vista. I even commented out the entire Before Update procedure and I am still getting the error. If I comment out the entire On Current procedure, i.e., the event procedure link in the form disappears. But, if I then specify an event procedure, i.e., it creates a new empty one, then the error returns. _ So, where does one go from here? _ Now what?
Gosh it’s been so long that I can’t remember anything regarding the issue!! But I appreciate you taking the time and effort to try to help
me…
Sincerely,
Joseph
I had the same problem…
Somehow, the VBA compiler lost reference data describing / linking my form to its code module (Hence it couldn’t locate the logic being referenced from the form’s events (and/or its controls’ events)
Two things I did to correct my problem:
-
Go to the VBA editor and open the “project explorer” view pane. Locate the suspected form’s code module and open it. FInd an existing procedure and enter a remark or make an arbitrary change in the module and save it. (You can go back and Undo any changes and save again.)
-
Open your form in Access Design mode; go to the property page of the form or one of its controls and reinstantiate the expression: “[Event Procedure]” in the box next to the object’s name. Again, this simes to re-establish the mapping between form and event code.
Run your form. Problem should be corrected. Note: You may have to repeat these steps for each form in your collection, until you find the form that spawns the error.
Hope this helps
Grant Collinsworth
Mysterious are the ways of the Access Form…
We’ll see if submitting from the web works this time… anyway, removing the module didn’t do the job on its own … same error returned as soon as I tried adding the module back in again, though, of course, no error while no module. But, copy and paste to a new form while no module and then adding in the module got all the same code working again. Thanks!
When Access baffles me that bad I usually remove the form’s module (Has module = no and Save) and then restore the code back in.
Alternatively - open a blank form and copy the code there, see if it solves the problem.
If all else fails - try to open a new DB and import everything there.