Database Form Events

The Events tab page, allows you to assign a macro to certain events which occur in a database form.

āĻāχ āύāĻŋāĻ°ā§āĻĻ⧇āĻļāĻžāĻŦāϞ⧀āϤ⧇ āϏāĻ¨ā§āύāĻŋāĻŦ⧇āĻļ āĻ•āϰāϤ⧇...

Open context menu of a selected form element - choose Form Properties - Events tab.

Open Form Design toolbar, click Form Properties icon - Events tab.


āĻāĻ•āϟāĻŋ āχāϭ⧇āĻ¨ā§āϟāϕ⧇ āĻāĻ•āϟāĻŋ āĻŽā§āϝāĻžāĻ•ā§āϰ⧋āϰ āϏāĻžāĻĨ⧇ āϞāĻŋāĻ‚āĻ• āĻ•āϰāϤ⧇, āĻĒā§āϰāĻĨāĻŽā§‡ āĻāĻ•āϟāĻŋ āĻŽā§āϝāĻžāĻ•ā§āϰ⧋ āϞāĻŋāϖ⧁āύ āϝāĻž āϝāĻ–āύ āχāϭ⧇āĻ¨ā§āϟāϟāĻŋ āϏāĻ‚āϘāĻ āĻŋāϤ āĻšāĻŦ⧇ āϤāĻ–āύ āϏāĻŽā§āĻĒāĻžāĻĻāĻŋāϤ āĻ•āϰāĻžāϰ āϜāĻ¨ā§āϝ āϏāĻŦ āĻ•āĻŽāĻžāĻ¨ā§āĻĄ āϧāĻžāϰāĻŖ āĻ•āϰ⧇āĨ¤ āϏāĻ‚āĻļā§āϞāĻŋāĻˇā§āϟ āχāϭ⧇āĻ¨ā§āĻŸā§‡āϰ āĻĒāĻžāĻļ⧇ ... āĻŦā§‹āϤāĻžāĻŽā§‡ āĻ•ā§āϞāĻŋāĻ• āĻ•āϰ⧇ āĻāϰāĻĒāϰ āĻāχ āĻŽā§āϝāĻžāĻ•ā§āϰ⧋ āύāĻŋāϜ āύāĻŋāϜ āχāϭ⧇āĻ¨ā§āĻŸā§‡ āĻŦāϰāĻžāĻĻā§āĻĻ āĻ•āϰ⧁āύāĨ¤ āĻŽā§āϝāĻžāĻ•ā§āϰ⧋ āĻŦāϰāĻžāĻĻā§āĻĻ āĻ•āϰ⧁āύ āĻĄāĻžā§ŸāĻžāϞāĻ— āϖ⧁āϞāĻŦ⧇, āϝ⧇āĻ–āĻžāύ⧇ āφāĻĒāύāĻŋ āĻŽā§āϝāĻžāĻ•ā§āϰ⧋ āύāĻŋāĻ°ā§āĻŦāĻžāϚāύ āĻ•āϰāϤ⧇ āĻĒāĻžāϰāĻŦ⧇āύāĨ¤

āύāĻŋāĻŽā§āύ⧋āĻ•ā§āϤ āĻ•āĻžāϜ āĻ¸ā§āĻŦāϤāĻ¨ā§āĻ¤ā§āϰāĻ­āĻžāĻŦ⧇ āĻ•āύāĻĢāĻŋāĻ—āĻžāϰ āĻ•āϰāĻž āϝ⧇āϤ⧇ āĻĒāĻžāϰ⧇, āĻāϰ āĻŽāĻžāύ⧇ āĻšāϞ āĻāĻ•āϟāĻŋ āĻ•āĻžāϜ āϚāĻžāϞāĻžāϤ⧇ āφāĻĒāύāĻžāϰ āύāĻŋāϜāĻ¸ā§āĻŦ āĻāĻ•āϟāĻŋ āĻĄāĻžāϝāĻŧāĻžāϞāĻ— āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻ•āϰāϤ⧇ āĻĒāĻžāϰ⧇āύāĨ¤

  1. āĻāĻ•āϟāĻŋ āĻ¤ā§āϰ⧁āϟāĻŋ āĻŦāĻžāĻ°ā§āϤāĻž āĻĒā§āϰāĻĻāĻ°ā§āĻļāύ āĻ•āϰāϛ⧇,

  2. āĻŽā§āϛ⧇ āĻĢ⧇āϞāĻžāϰ āĻāĻ•āϟāĻŋ āĻĒā§āϰāĻ•ā§āϰāĻŋāϝāĻŧāĻž āύāĻŋāĻļā§āϚāĻŋāϤ āĻ•āϰāϛ⧇ (āĻĄāĻžāϟāĻž āϰ⧇āĻ•āĻ°ā§āĻĄā§‡āϰ āϜāĻ¨ā§āϝ),

  3. āϜāĻŋāĻœā§āĻžāĻžāϏāĻ• āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāϟāĻžāϰ,

  4. āĻāĻ•āϟāĻŋ āĻĄāĻžāϟāĻž āϰ⧇āĻ•āĻ°ā§āĻĄ āϏāĻ‚āϰāĻ•ā§āώāύ⧇āϰ āϏāĻŽāϝāĻŧ āχāύāĻĒ⧁āϟ āĻĒāϰ⧀āĻ•ā§āώāĻž āĻ•āϰāϛ⧇āĨ¤

āωāĻĻāĻžāĻšāϰāĻŖāĻ¸ā§āĻŦāϰ⧂āĻĒ, āĻāĻ•āϟāĻŋ āϰ⧇āĻ•āĻ°ā§āĻĄ āĻŽā§āϛ⧇ āĻĢ⧇āϞāĻžāϰ āϏāĻŽāϝāĻŧ āφāĻĒāύāĻŋ "āĻŽā§āϛ⧇ āĻĢ⧇āϞāĻž āύāĻŋāĻļā§āϚāĻŋāϤāĻ•āϰāĻŖ" āĻ…āύ⧁āϰ⧋āϧ āϝ⧇āĻŽāύ, "āϏāĻ¤ā§āϝāĻŋāχ āĻ•āĻŋ āĻ—ā§āϰāĻžāĻšāĻ• xyz āĻŽā§āϛ⧇ āĻĢ⧇āϞāϤ⧇ āϚāĻžāύ?" āĻāϟāĻŋ āχāĻ¸ā§āϝ⧁ āĻ•āϰāϤ⧇ āĻĒāĻžāϰ⧇āύāĨ¤

note

The events that are shown in the Events dialog cannot be edited directly. You can remove an event from the list by pressing the Del key.


āύāĻŋāĻŽā§āύ⧋āĻ•ā§āϤāϟāĻŋ āĻāĻ•āϟāĻŋ āĻ—āĻ āύ⧇āϰ āϏāĻŦ āĻ…āύ⧁āĻˇā§āĻ āĻžāύ āϤāĻžāϞāĻŋāĻ•āĻžāĻŦāĻĻā§āϧ āĻāĻŦāĻ‚ āĻŦāĻ°ā§āĻŖāύāĻž āĻ•āϰāϤ⧇ āĻĒāĻžāϰ⧇ āϝāĻž āĻāĻ•āϟāĻŋ āĻŽā§āϝāĻžāĻ•ā§āϰ⧋āϤ⧇ āϝ⧁āĻ•ā§āϤ āĻĨāĻžāĻ•āϤ⧇ āĻĒāĻžāϰ⧇:

āφāύāϞ⧋āĻĄ āĻ•āϰāĻžāϰ āĻĒā§‚āĻ°ā§āĻŦ⧇

The Before unloading event occurs before the form is unloaded; that is, separated from its data source.

āĻ¤ā§āϰ⧁āϟāĻŋ āϘāĻŸā§‡āϛ⧇

The Error occurred event is activated if an error occurs when accessing the data source. This applies to forms, list boxes and combo boxes.

āĻĒ⧁āύāϰāĻžāϝāĻŧ āϞ⧋āĻĄ āĻ•āϰāĻžāϰ āφāϗ⧇

The Before reloading event occurs before the form is reloaded. The data content has not yet been refreshed.

āĻĒā§āϝāĻžāϰāĻžāĻŽāĻŋāϟāĻžāϰ āĻĒā§‚āϰāĻŖ āĻ•āϰ⧁āύ

The Fill parameters event occurs when the form to be loaded has parameters that must be filled out. For example, the data source of the form can be the following SQL command:

SELECT * FROM address WHERE name=:name

Here :name is a parameter that must be filled out when loading. The parameter is automatically filled out from the parent form if possible. If the parameter cannot be filled out, this event is called and a linked macro can fill out the parameter. Return True when the execution of the parametrized statement should continue, False otherwise.

āĻĒā§āϰāĻĻāĻžāύ⧇āϰ āφāϗ⧇

The Before submitting event occurs before the form data is sent. Returning True approves the submission, False stops it.

āĻŽā§āϛ⧇ āĻĢ⧇āϞāĻž āύāĻŋāĻļā§āϚāĻŋāϤāĻ•āϰāĻŖ

The Confirm deletion event occurs as soon as data has been deleted from the form. Return True to allow row deletion, False otherwise. For example, the linked macro can request confirmation in a dialog.

āϝāĻ–āύ āφāύāϞ⧋āĻĄ āĻ•āϰāĻž āĻšāĻšā§āϛ⧇

The When unloading event occurs directly after the form has been unloaded; that is, separated from its data source.

āϝāĻ–āύ āϞ⧋āĻĄ āĻ•āϰāĻž āĻšāĻšā§āϛ⧇

The When loading event occurs directly after the form has been loaded.

āϝāĻ–āύ āϞ⧋āĻĄ āĻ•āϰāĻž āĻšāĻšā§āϛ⧇

The When reloading event occurs directly after the form has been reloaded. The data content has already been refreshed.

āϰ⧇āĻ•āĻ°ā§āĻĄ āĻ•āĻžāϜāϰ āφāϗ⧇

The Before record action event occurs before the current record or record set are changed. Return True when changing is allowed, otherwise False. For example, the linked macro can request confirmation in a dialog.

āϰ⧇āĻ•āĻ°ā§āĻĄ āĻ•āĻžāϜāϰ āĻĒāϰ⧇

The After record action event occurs directly after the current record has been changed.

āϰ⧇āĻ•āĻ°ā§āĻĄ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ⧇āϰ āφāϗ⧇

The Before record change event occurs before the current record pointer - SQL cursor - is changed. Return True when moving is allowed, otherwise False.

āϰ⧇āĻ•āĻ°ā§āĻĄ āĻĒāϰāĻŋāĻŦāĻ°ā§āϤāύ⧇āϰ āĻĒāϰ⧇

The After record change event occurs directly after the current record pointer has been changed.

āĻšāĻžāϞāύāĻžāĻ—āĻžāĻĻ āĻ•āϰāĻžāϰ āφāϗ⧇

The Before update event occurs before the control content changed by the user is written into the data source. The linked macro can, for example, prevent this action by returning FALSE.

āĻšāĻžāϞāύāĻžāĻ—āĻžāĻĻ āĻ•āϰāĻžāϰ āĻĒāϰ⧇

The After update event occurs after the control content changed by the user has been written into the data source.

āĻĒ⧁āύāϰāĻžāϝāĻŧ āĻ¸ā§āĻĨāĻžāĻĒāύ āĻ•āϰāĻžāϤ⧇ āĻĒā§āϰāĻžāϧāĻžāĻ¨ā§āϝ

The Prior to reset event occurs before a form is reset. Returning True approves the reset, returning False cancels the operation.

āĻ—āĻ āύāϟāĻŋ āĻĒ⧁āύāϰāĻžāϝāĻŧ āύāĻŋāϝ⧁āĻ•ā§āϤ āĻšāϝāĻŧ āϝāĻĻāĻŋ āύāĻŋāĻŽā§āύ⧋āĻ•ā§āϤ āϝ⧇āϕ⧋āύ⧋ āĻāĻ•āϟāĻŋ āĻļāĻ°ā§āϤ āĻĒā§‚āϰāĻŖ āĻ•āϰāĻž āĻšāϝāĻŧ:

  1. āĻŦā§āϝāĻŦāĻšāĻžāϰāĻ•āĻžāϰ⧀ āĻāĻ•āϟāĻŋ HTML āĻŦā§‹āϤāĻžāĻŽ āϚāĻžāĻĒ⧇ āϝāĻž āĻĒ⧁āύāϰāĻžāϝāĻŧ āύāĻŋāϝ⧁āĻ•ā§āϤāĻ•āϰāĻŖ āĻŦā§‹āϤāĻžāĻŽ āĻšāĻŋāϏ⧇āĻŦ⧇ āĻŦā§āϝāĻžāĻ–ā§āϝāĻžāĻ•ā§ƒāϤāĨ¤

  2. āĻāĻ•āϟāĻŋ āύāϤ⧁āύ āĻāĻŦāĻ‚ āĻĢāĻžāρāĻ•āĻž āϰ⧇āĻ•āĻ°ā§āĻĄ āĻāĻ•āϟāĻŋ āĻĢāĻ°ā§āĻŽā§‡ āϤ⧈āϰāĻŋ āĻ•āϰāĻž āĻšāĻŦ⧇ āϝāĻž āĻāĻ•āϟāĻŋ āĻĄāĻžāϟāĻž āĻ‰ā§ŽāϏ⧇āϰ āϏāĻžāĻĨ⧇ āϏāĻ‚āϝ⧁āĻ•ā§āϤāĨ¤ āωāĻĻāĻžāĻšāϰāĻŖāĻ¸ā§āĻŦāϰ⧂āĻĒ, āĻļ⧇āώ āϰ⧇āĻ•āĻ°ā§āĻĄā§‡, āĻĒāϰāĻŦāĻ°ā§āϤ⧀ āϰ⧇āĻ•āĻ°ā§āĻĄ āĻŦā§‹āϤāĻžāĻŽ āϏāĻŽā§āĻ­āĻŦāϤ āϚāĻžāĻĒāĻž āĻšāĻŦ⧇āĨ¤

āĻĒ⧁āύāϰāĻžāϝāĻŧ āĻ¸ā§āĻĨāĻžāĻĒāύ āĻ•āϰāĻžāϰ āĻĒāϰ

The After resetting event occurs after a form has been reset.

Vetoable events

tip

Macros can interrupt event execution when they return a boolean value: True allows the execution of the event to continue and False stops the event execution.


The following events are interruptable by returning False:

Please support us!