I have this code:
For iTabCount = 2 To tabCtrl_Contact.TabPages.Count - 1
iGroupID = 0
sSQL = ""
For iCount = 0 To
tabCtrl_Contact.TabPages(iTabCount).Controls.Count - 1
oControl =
tabCtrl_Contact.TabPages(iTabCount).Controls(iCoun t)
iFieldIndex = 0
If Mid(oControl.Name, 1, 3) <> "lbl" Then
If Mid(oControl.Name, 1, 3) = "rad" Then
If CType(oControl, RadioButton).Checked = True Then
arrName = Split(oControl.Name, "_") ' Format
should be: prefix_groupID_index
If UBound(arrName) = 2 Then
iGroupID = arrName(1)
iFieldIndex = arrName(2)
sAnswer = oControl.Text
End If
End If
Else
arrName = Split(oControl.Name, "_") ' Format should
be: prefix_groupID_index
If UBound(arrName) = 2 Then
iGroupID = arrName(1)
iFieldIndex = arrName(2)
sAnswer = oControl.Text
End If
End If
sSQL = sSQL & _
"Field Index: " & iFieldIndex & " >> " & sAnswer
& vbCrLf
End If
Next
Next
The purpose of the code above is to trace all controls (EXCEPT label) in tab
pages, and get the value of each control.
I tried to grab the values using this statement:
sAnswer = oControl.Text
But it always bring me "blank" value, even though those controls have
values.
Any ideas where am I missing here?
Thank you,
DC