Moderator
This thread has been moved. New questions should go into new threads.
This thread has been moved. New questions should go into new threads.
Hi Guys,
I am completely lost, trying to get the code found in:
how-check-if-all-textboxes-form-null to work
I am trying the code but I keep getting the error;
'The object doesn't support this property or method'
Runtime error '438'.
Code:
Dim ctl As control
Dim check As Boolean
check = True
For Each ctl In Me.Controls
If ctl.contoltype = acTextBox Then
If ctl.Value = "" Then
check = False
End If
End If
Next ctl
If check = False Then
MsgBox "There is no information provided", vbOKOnly
Me.lstResults.RowSource = ""
Else
ListSearchresults
End If
Code:
If ctl.contoltype = acTextBox Then
What i want is when the search button is clicked, to make sure at least one text box has a value. if none have a value then to throw the error message and exit sub, other run the Listsearchresul ts sub.
Any help and guidance would be much appreciated.
Comment