How to assign a macro to the opening of a dialog

In LibreOffice Base, I open a dialog from a Basic macro. When the dialog is displayed, I want to run another macro to fill in initial field values. Within a form, as opposed to a dialog, the properties of the controls contain a form property which allows setting properties for the form. Within a dialog there appears to be no way to assign a macro to an event such as open dialog.

A code sample would help. A common workaround would be to pop up a small form instead of a dialog box. The small form could have the commands you need, and would have only a slightly different aesthetic.