Hi,
I'm trying my luck with For Each control array logic and I'm confused as to why VB is returning the caption for the control, instead of the name(index)
Here is my code:
now the Container for the first 5 controls is a frame with the name of "Frame_Orders". The caption for that frame is "<Orders>"Code:Dim daCtrl As Control For Each daCtrl In frmMain.Controls If TypeOf daCtrl Is ComboBox Then msgbox daCtrl.Container end if Next
The msgbox shows "<Orders>" But I am not asking for the Container.Caption value, I want the actual object name. It would seem almost obvious that VB would return the object name but apparently not. How do I get it to return the name instead of the caption?




Reply With Quote