You could add a property to UserForm5.
' in UsedForm5 code module
Public myParent As Object
Private Sub txtEnteredDate_Change()
With myParent.Controls(txtEnteredDate.Tag)
.Value = txtEnteredDate.Text
End With
End Sub
Which control in the calling UF can be specified with the .Tag property of the called text box
' in UF 1 code module
'...
Private Sub CommandButton1_Click()
Dim aForm As New UserForm5
With aForm
Set .myParent = Me
.txtEnteredDate.Tag = "ComboBox1"
.Show
End With
End Sub
' in UF2 code module
'...
Private Sub CommandButton1_Click()
Dim aForm As New UserForm5
With aForm
Set .myParent = Me
.txtEnteredDate.Tag = "TextBox1"
.Show
End With
End Sub
Bookmarks