开发者

Error handling event of control on subform

开发者 https://www.devze.com 2023-01-25 08:28 出处:网络
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

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 t开发者_如何学Che 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....

0

精彩评论

暂无评论...
验证码 换一张
取 消