How do I pass a form's TextBox object to the a method?
The following code is issuing an exception.
Private Sub DoSmthWithTextBox(ByRef txtBox as TextBox)
txtBox.BackColor = vbRed
End Sub
Private Sub TextBox1_Change()
DoSmthWithTextBox Me.TextBox1
End Sub
The problem appears when DoSmthWithTextBox Me.TextBox1 passes the String from TextBox1 instead of the object reference.
How do I pass the TextBox object to the DoSmthWithTextBox method?