I wrote a function that loops through all the controls of a form, so that I could set some of the properties of all those that belong to a certain container.
This is a small version of that function:
When I call the functionVB Code:
Public Sub setControls(ByVal formulary As Form, ByVal prefix As String, text As String) prefix = UCase(prefix) Dim control As control For Each control In formulary.Controls If InStr(1, UCase(control.Container.Name), prefix) > 0 Then If TypeName(control) = "TextBox" Then control.text = text End If End If Next End Sub
it sets every textbox text to "Hi" in all containers whose name starts on "Frame". BUT (cause there is a but) in the case of a SSTab control it's different, because I can't change the properties of the members of just ONE specific tab since the container is the SSTab control and not something like SSTab(1).VB Code:
Call setControls(Me, "Frame", "Hi")
The thing is: is there any way to know is a control belongs to a specific tab in a SSTab control?




Reply With Quote