Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Please, find the sample code, as requested.</p> <p>This is the class clsForm code:</p> <pre><code>---------------------------------------------------------------------------------------- Option Compare Database Option Explicit Private WithEvents frmFormulary As Form Public Event OpenForm(Cancel As Integer) Public Event LoadForm() Public Event UnloadForm(Cancel As Integer) Public Event CloseForm() Public Property Set Formulary(frmForm As Form) Set frmFormulary = frmForm frmFormulary.OnOpen = "[Event Procedure]" frmFormulary.OnLoad = "[Event Procedure]" frmFormulary.OnUnload = "[Event Procedure]" frmFormulary.OnClose = "[Event Procedure]" End Property Public Sub ShowForm() frmFormulary.Visible = True End Sub Private Sub frmFormulary_Open(Cancel As Integer) RaiseEvent OpenForm(Cancel) MsgBox "Event Open from clsFormulary class" End Sub Private Sub frmFormulary_Load() RaiseEvent LoadForm End Sub Private Sub frmFormulary_Unload(Cancel As Integer) RaiseEvent UnloadForm(Cancel) End Sub Private Sub frmFormulary_Close() RaiseEvent CloseForm End Sub Private Sub Class_Terminate() Set frmFormulary = Nothing End Sub ---------------------------------------------------------------------------------------- </code></pre> <p>This is the form code:</p> <pre><code>---------------------------------------------------------------------------------------- Option Compare Database Option Explicit Private Sub btnTeste_Click() On Error GoTo TreatError Dim objScreen As clsFormulary Set objScreen = New clsFormulary objScreen.Formulary (Application.CurrentProject.AllForms("frmScreenTest")) objScreen.ShowForm ExitError: 'Set objScreen = Nothing Exit Sub TreatError: Resume ExitError End Sub ---------------------------------------------------------------------------------------- </code></pre> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload