Opening a form modally I am writing.
CustomerForm.Show vbModal, me
On CustomerForm - how do I reference the form that opened the CustomerForm?
Thanks for any help
Printable View
Opening a form modally I am writing.
CustomerForm.Show vbModal, me
On CustomerForm - how do I reference the form that opened the CustomerForm?
Thanks for any help
And then you can use CustomerForm.ShowModal Me in the other forms to open it. The form will remember the parent and you could even check the latest parent from modules and classes by using CustomerForm.ParentForm.Code:' in customer form
Dim m_ParentForm As Form
Public Property Get ParentForm() As Form
Set ParentForm = m_ParentForm
End Property
Public Sub ShowModal(Optional ByRef Parent As Form)
Set m_ParentForm = Parent
Me.Show vbModal, m_ParentForm
End Sub