I have a series of text boxes that I want to evaluate on form load to change some other elements of the form. Rather than processing them line by line I want to create a function. How can I pass the name of the text box to a function. For example:
Private Sub Form_Load()
Call SetIntialToggleValue(MyTextboxName)
End Sub
Private Sub SetIntialToggleValue(ByRef ControlName As Control)
MsgBox ControlName.Value
End Sub
This give me "Object required" error on the MsgBox line. Which makes me think I'm not passing the textbox control properly.
Dim
statement should go in theForm_Load()
method. – Sunnysunproof