简体   繁体   中英

Error handling event of control on subform

So, I built a form in Access 2007, and put a subform on it. Then I went to the Property Sheet for one of the controls on the subform and used the builder to point to Code Builder for the OnClick event. This opened the VBA editor & inserted a sub skeleton. I added code here (just a freakin' MsgBox, so far), saved & tried running (opening) the form. It looks good, but clicking the control that has event code yields this, immediately:

The expression On Click you entered as the event property setting produced the following error: A problem occurred while Microsoft Access as communicating with the OLE server of ActiveX Control.

The so-called Help on the error notification is completely useless. It reads:

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.

Access knew what was going on at design time, since it dropped me into VBA. The Property Sheet entry does read "[Event Procedure]". Is there a secret ninja trick to handling events from a subform, or is it just not possible?

I deleted the problem subform & created a new one. This one seems to work as expected. Go figure....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM