Values can't be grabbed?

  • Thread starter Thread starter DC
  • Start date Start date
D

DC

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(iCount)
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
 
I have ths code:

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?

Are you aware of the fact that you have to loop through the controls
recursively?

http://www.apress.com/ApressCorporate/supplement/1/379/1590594266-2093.pdf

Cheers

Arne Janning
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top