开发者

Raising an Event/Calling a Method on a MS Access form from a C# MS Access COMAddIn

I have an VS 2008 C# MS Access add-in and I wanted to know how I could raise events or call methods on an MS Access form. Simply put, how do I raise an event or call a method on a Microsoft.Office.Interop.Access.Form object from within C# 开发者_如何学Pythonand get the VBA code to execute o the MS Access side. Please anyone, let me know if such a thing is possible and how.


I never found a good solution for this and had to go with a work-around. If I keep a reference to a TextBox in my C# AddIn code and I change the Text property within my C# code, if there is a VBA handler associated with that TextBox, the Change event will be raised. The Text property will not fire the change event if the text value is too great. So a work-around for that work-around is to use two TextBoxes; one to raise the event (just set the Text property to any text like the word "event") and another TextBox that stores the actual data in it's Value property. This is stupid but it works.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜