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. ΠŸΡ€ΠΎΠ²Π΅Ρ€ΠΊΠ° Π²Π²Π΅Π΄Π΅Π½Π½ΠΎΠΉ ΠΈΠ½Ρ„ΠΎΡ€ΠΌΠ°Ρ†ΠΈΠΈ ΠΏΡ€ΠΈ сохранСнии записи.

ΠŸΡ€ΠΈ ΡƒΠ΄Π°Π»Π΅Π½ΠΈΠΈ записи ΠΌΠΎΠΆΠ΅Ρ‚ ΠΏΠΎΡΠ²ΠΈΡ‚ΡŒΡΡ запрос ΠΏΠΎΠ΄Ρ‚Π²Π΅Ρ€Π΄ΠΈΡ‚ΡŒ ΡƒΠ΄Π°Π»Π΅Π½ΠΈΠ΅, Π½Π°ΠΏΡ€ΠΈΠΌΠ΅Ρ€, "Π’Ρ‹ Π΄Π΅ΠΉΡΡ‚Π²ΠΈΡ‚Π΅Π»ΡŒΠ½ΠΎ Ρ…ΠΎΡ‚ΠΈΡ‚Π΅ ΡƒΠ΄Π°Π»ΠΈΡ‚ΡŒ ΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚Π΅Π»Ρ Π•Π²Π³Π΅Π½ΠΈΠΉ?".

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 Before record change event occurs before the current record pointer - SQL cursor - is changed. Return True when moving is allowed, otherwise False.

ΠŸΠ΅Ρ€Π΅Π΄ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ΠΌ

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.

ΠŸΠ΅Ρ€Π΅Π΄ ΠΎΡ‚ΠΏΡ€Π°Π²ΠΊΠΎΠΉ

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

ΠŸΠ΅Ρ€Π΅Π΄ ΠΏΠΎΠ²Ρ‚ΠΎΡ€Π½ΠΎΠΉ Π·Π°Π³Ρ€ΡƒΠ·ΠΊΠΎΠΉ

The Before reloading event occurs before the form is reloaded. The data content has not yet 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 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 After record change event occurs directly after the current record pointer has been changed.

ПослС сохранСния

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

ΠŸΡ€ΠΈ Π²ΠΎΠ·Π½ΠΈΠΊΠ½ΠΎΠ²Π΅Π½ΠΈΠΈ ошибки

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 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 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 When reloading event occurs directly after the form has been reloaded. The data content has already been refreshed.

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: