You can pass objects through forms. Here is a small sample project:
VB Code:
'Form1: Option Explicit Private Sub Command1_Click() Form2.SetLabel Label1 Form2.Show vbModal End Sub
VB Code:
'Form2: Option Explicit Dim MyLabel As Label Public Sub SetLabel(ByRef TheLabel As Label) Set MyLabel = TheLabel End Sub Private Sub Command1_Click() MyLabel.Caption = MyLabel.Caption & " Changed content" Unload Me End Sub Private Sub Form_Unload(Cancel As Integer) Set MyLabel = Nothing End Sub
Hope this helps![]()




Reply With Quote