Hi , I am new to the forum, so sorry if this is in the wrong place, and should be under VB code. Also, I searched the forum. So I don't think this question has been answered.
I am looking for a way to calculate the number of unfilled controls per tab page. Then write that total number out to a seperate text field on a different tab. I have code so far that will give me the total unfilled controls for the whole form, but not broken down by tab. I have written code for each tab. I have a lot of controls, so I am looking for a way to do this, without having to write an if/then for each control. My code is below. Thanks.
-----------------------------------------------------------------
Private Sub Page27_Click()
Dim ctl As Control
Dim frm As Page
Dim N As Integer
Dim Text864 As String
Text864 = ""
N = 0
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
If IsNull(ctl) Then
N = N + 1
End If
End If
Next ctl
Text864 = Text864 & "There are " & N & " incomplete entries in this section."
Me!Text864 = Text864
End Sub
I am looking for a way to calculate the number of unfilled controls per tab page. Then write that total number out to a seperate text field on a different tab. I have code so far that will give me the total unfilled controls for the whole form, but not broken down by tab. I have written code for each tab. I have a lot of controls, so I am looking for a way to do this, without having to write an if/then for each control. My code is below. Thanks.
-----------------------------------------------------------------
Private Sub Page27_Click()
Dim ctl As Control
Dim frm As Page
Dim N As Integer
Dim Text864 As String
Text864 = ""
N = 0
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
If IsNull(ctl) Then
N = N + 1
End If
End If
Next ctl
Text864 = Text864 & "There are " & N & " incomplete entries in this section."
Me!Text864 = Text864
End Sub