-
My question is close to the last persons but a little diff:
I want to populate all of the textboxes that are null with "Must Enter" until they are filled in with info. What is an easier or shorter way to do it rather than addressing each individual textbox as 'if null then'?
-
Try this code to see if it works with what you are trying to do.
Code:
Private Sub Command1_Click()
' This code will loop through all controls on your form.
' It will only process the textboxes.
Dim Thing As Variant
For Each Thing In Form1
If TypeOf Thing Is TextBox Then
If Thing.Text = "" Then
' Do what you need to do
End If
End If
Next Thing
End Sub