بعد از تنظیم مسیرهای مورد نظر در جدول مربوطه ، برنامه بدرستی اجرا خواهد شد.
شاید صرف وقت برای پیاده سازی چنین کاری بیهوده به نظر بیاد اما به هر حال تجربه جدیدی خواهد بود برای گروه برنامه نویسان اکسس. در این به جای استفاده از فرم های مرسوم اکسس از فرم های طراحی شده با HTML استفاده میشه
در راهنمای برنامه هم اجرای کدها از طریق وب بروزر امده است:
Each HTML template is granted by the framework with a unique
eventDispatcher element at runtime that automaticaly connect the HTML events with your VBA code via internal GUID.
Now all you have to do is place this little piece of code in your HTML element to react to HTML events in VBA:
کد HTML:
xhv-eventlistener xhv-event="click" xhv-eventhandler="ShowMessage" xhv-params=""
Which means, when the user click on this HTML element (this can be a button or any clickable HTML element), call this VBA function (MyVBAFunction) in the component with these parameter values (xhv-params).
Example, you want to show a msgbox when the user pass over a HTML link:
In the HTML :
کد HTML:
<a xhv-eventlistener xhv-event="onmouseover" xhv-eventhandler="ShowMessage" xhv-params=""
Call msgbox
</a>
In the component VBA code:
Public Sub ShowMessage(ParamArray args() As Variant)
MsgBox args(0)
End Sub
That’s it!
When the user hover the link, HandleView will dispatch the event to the ShowMessage Function of the component and include “Hi” as a string parameters to the function in the args() ParamArray.
Now, what you do in your function is up to you You want to save a client in your database, do it. You want to show a Popup windows created in JavaScript, call it (with a VBA helper function)
, it’s pretty full VBA from now on