L
Lesli
I am helping a co-worker with a database that is using a main form with a tab
control with a subform on each tab. She needs to be able to loop through the
controls on the form and each subform to check for missing data and return a
list to the user. I have the basic code to loop through the main form and
return the ctl.Name, but what we really need is to return the label because
the name isn't going to be very helpful to the user. We tried putting text
in the Status Bar Text field to see if we could return that, but didn't have
any luck. The plan is to get the list and then display it in an unbound
control that users can reference (rather than a message box). I'm using the
debug.print line to test the concatenation.
Here's the basic code that I'm starting with. It works. (I know the actually
validating of the field values isn't included in the code yet. RIght now,
I'm just trying to return a list that will be useful to the user).
Dim myList, ctlName As String
For Each ctl In Me.Controls
ctlName = ctl.Name
If ctl.Tag = "Validate" Then
myList = myList & ctlName & " : "
End If
Next
Debug.print myList
So, I have two questions:
1. How can I return the label or the Status Bar Text or something else
useful instead of the control name?
2. How do I loop through all the subforms and concatenate those lists to the
main form list?
Thanks in advance for your help!
Lesli
control with a subform on each tab. She needs to be able to loop through the
controls on the form and each subform to check for missing data and return a
list to the user. I have the basic code to loop through the main form and
return the ctl.Name, but what we really need is to return the label because
the name isn't going to be very helpful to the user. We tried putting text
in the Status Bar Text field to see if we could return that, but didn't have
any luck. The plan is to get the list and then display it in an unbound
control that users can reference (rather than a message box). I'm using the
debug.print line to test the concatenation.
Here's the basic code that I'm starting with. It works. (I know the actually
validating of the field values isn't included in the code yet. RIght now,
I'm just trying to return a list that will be useful to the user).
Dim myList, ctlName As String
For Each ctl In Me.Controls
ctlName = ctl.Name
If ctl.Tag = "Validate" Then
myList = myList & ctlName & " : "
End If
Next
Debug.print myList
So, I have two questions:
1. How can I return the label or the Status Bar Text or something else
useful instead of the control name?
2. How do I loop through all the subforms and concatenate those lists to the
main form list?
Thanks in advance for your help!
Lesli