Calculating Unfilled controls per tab page.

Boreas

New member
Local time
Yesterday, 21:45
Joined
Feb 26, 2004
Messages
5
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
 
The controls on tabs on a form are actually controls on the form, as you've probably found out.

One solution is to put an indicator in the tag property of each control (on a tab) which indicates which tab the control is on, if any.

Otherwise, you're cycling through the form controls correctly.
 

Users who are viewing this thread

Back
Top Bottom