create 2 forms and 2 buttons on each
dump the following code in, see what
gonna happen.
'---form1---
Option Explicit
Public P_PARENT As Form
Private Sub Command1_Click()
Set Form2.P_PARENT = Me
Form2.Show
End Sub
Private Sub Command2_Click()
If Not P_PARENT Is Nothing Then
MsgBox P_PARENT.Name
Else
MsgBox "NO PARENT"
End If
End Sub
'---form2---
Option Explicit
Public P_PARENT As Form
Private Sub Command1_Click()
Set Form1.P_PARENT = Me
Form1.Show
End Sub
Private Sub Command2_Click()
If Not P_PARENT Is Nothing Then
MsgBox P_PARENT.Name
Else
MsgBox "NO PARENT"
End If
End Sub
dump the following code in, see what
gonna happen.
'---form1---
Option Explicit
Public P_PARENT As Form
Private Sub Command1_Click()
Set Form2.P_PARENT = Me
Form2.Show
End Sub
Private Sub Command2_Click()
If Not P_PARENT Is Nothing Then
MsgBox P_PARENT.Name
Else
MsgBox "NO PARENT"
End If
End Sub
'---form2---
Option Explicit
Public P_PARENT As Form
Private Sub Command1_Click()
Set Form1.P_PARENT = Me
Form1.Show
End Sub
Private Sub Command2_Click()
If Not P_PARENT Is Nothing Then
MsgBox P_PARENT.Name
Else
MsgBox "NO PARENT"
End If
End Sub