Sucesos

La pestaña Sucesos permite asignar una macro a determinadas acciones asociadas a un formulario.

Para acceder a esta orden…

Abra el menú contextual de un elemento seleccionado del formulario y elija Formulario ▸ pestaña Sucesos.

Abra bien la barra de herramientas Controles de formulario o bien la barra Diseño de formulario, pulse en el icono Formulario y navegue a la pestaña Sucesos.


Para enlazar un suceso con una macro, primero grabe una macro que contenga todas las órdenes que deban ejecutarse cuando se produzca el suceso. Luego, asigne esta macro al suceso respectivo: para ello, pulse en el botón ubicado junto al suceso. Se abrirá la ventana Asignar macro, que le permitirá seleccionar la macro.

Se pueden configurar las acciones siguientes de manera individual, es decir, puede usar sus propios cuadros de diálogo para representar una acción:

  1. Mostrar un mensaje de error,

  2. Confirmar un proceso de eliminación (de registros de datos),

  3. Consultar parámetros,

  4. así como comprobar las entradas al guardar un registro.

Por ejemplo, es posible crear una solicitud de "confirmación de borrado" como "¿Quiere borrar realmente al cliente xyz?" al borrar un registro de datos.

Icono de nota

Los sucesos que se muestran en el cuadro de diálogo Sucesos no se pueden editar directamente. Puede eliminar un suceso de la lista si oprime la tecla Supr.


A continuación se enumeran y describen todos los sucesos de formulario que pueden enlazarse con una macro:

Al cargar

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

Al descargar

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

Al recargar

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

Antes de actualizar

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".

Después de actualizar

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

Antes de restablecer

The Prior to reset event occurs before a form is reset. The linked macro can, for example, prevent this action by returning "FALSE".

Se restablecerá un formulario cuando se cumpla una de las siguientes condiciones:

  1. El usuario pulsa un botón (HTML-) definido como botón Reset.

  2. Se crea un registro nuevo vacío en un formulario vinculado a la fuente de datos. Por ejemplo, se puede pulsar el botón Registro siguiente en el último registro.

Después de restablecer

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

Antes de descargar

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

Antes de la acción del registro de datos

The Before record action event occurs before the current record is changed. For example, the linked macro can request confirmation in a dialog.

Antes de recargar

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

Antes del cambio del registro de datos

The Before record change event occurs before the current record pointer is changed. For example, the linked macro can prevent this action by returning "FALSE".

Antes del envío

The Before submitting event occurs before the form data is sent.

Confirmar eliminación

The Confirm deletion event occurs as soon as data has been deleted from the form. For example, the linked macro can request confirmation in a dialog.

Ha ocurrido un error

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

Rellenar parámetros

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

:name es un parámetro que debe ser rellenado al cargar. El parámetro se rellenará automáticamente desde un formulario principal, siempre que sea posible. Si no se puede rellenar el parámetro, se ejecutará este acontecimiento y una macro vinculada rellenará el parámetro.

Tras el cambio del registro de datos

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

Tras la acción del registro de datos

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

¡Necesitamos su ayuda!