I know this has been convered before, but those thread all seem to stop short of the sort of code that I need.
I have a form (frmSupplyRequestDetail) that has 100 or so textboxes as well as a subform (frmGlovesSubForm). The subform has about 30 textboxes of its own. I need to loop through the textboxes in both the mainform and the subform to check for nulls. Currently I have the following code that works fine to go through the main form.
Dim ctl as Control
For Each ctl In Forms!frmSupplyRequestDetail
If ctl.ControlType = acTextBox Then
If ctl.Visible = True Then
If ctl.Locked = False Then
If Not IsNull(ctl) Then
NullCheck = "No"
End If
End If
End if
End if
Next ctl
I know I could create another loop that goes through the subform, but I would rather incorporate it all into one loop as more subforms are going to be added in the future and I don't want to have to create a loop for each one.
Thanks.
I have a form (frmSupplyRequestDetail) that has 100 or so textboxes as well as a subform (frmGlovesSubForm). The subform has about 30 textboxes of its own. I need to loop through the textboxes in both the mainform and the subform to check for nulls. Currently I have the following code that works fine to go through the main form.
Dim ctl as Control
For Each ctl In Forms!frmSupplyRequestDetail
If ctl.ControlType = acTextBox Then
If ctl.Visible = True Then
If ctl.Locked = False Then
If Not IsNull(ctl) Then
NullCheck = "No"
End If
End If
End if
End if
Next ctl
I know I could create another loop that goes through the subform, but I would rather incorporate it all into one loop as more subforms are going to be added in the future and I don't want to have to create a loop for each one.
Thanks.