This event example uses a Button object in the Form Editor.
Select File | Reporting | New | Form Report to open the Form Editor.
First, insert a button into your form by clicking on the Button icon () on the Object toolbar and then dragging out a rectangle for the button onto the form.
Make sure that the button is selected (highlighted).
Right-click on the button to bring up the dialog box that shows the button’s properties.
If the list is not expanded, click on the + sign next to the Events section to expand the list. You should see a list of all of the available event handler functions for the button object.
Double-click the EventClick function in the list. A Visual BASIC Editor entitled VBS Mini-Editor opens.
Add the following code to
the EventClick function inside the VBS
Mini Editor:
MsgBox "I've been clicked."
Click the OK button in the upper right-hand corner of the VBS Mini-Editor. Close the Property Sheet.
Save the report by selecting File | Save. You are now ready to test the report in run mode.
Switch to run mode (press CTRL + E).
Click on the button you created. A message box with the text I’ve been clicked! should appear.
This simple example illustrates the basics of scriptable forms and event handlers.