Option
Explicit
Private
Sub
ComboBox1_Change()
TextBox1.Text = TB_fuellen
End
Sub
Private
Sub
ComboBox2_Change()
TextBox1.Text = TB_fuellen
End
Sub
Private
Sub
ComboBox3_Change()
TextBox1.Text = TB_fuellen
End
Sub
Private
Function
TB_fuellen()
As
String
Dim
ctrCTR
As
Control
Dim
ctrCB
As
ComboBox
Dim
strTBText
As
String
Dim
ctrSpalte
As
Long
TB_fuellen =
""
ctrSpalte = 1
For
Each
ctrCTR
In
Me
.Controls
If
InStr(1, UCase(ctrCTR.Name),
"COMBOBOX"
, vbBinaryCompare) <> 0
Then
Set
ctrCB = ctrCTR
If
ctrCB.ListIndex = -1
Then
Set
ctrCB =
Nothing
Exit
Function
Else
Set
ctrCB =
Nothing
End
If
End
If
Next
For
Each
ctrCTR
In
Me
.Controls
If
InStr(1, UCase(ctrCTR.Name),
"COMBOBOX"
, vbBinaryCompare) <> 0
Then
Set
ctrCB = ctrCTR
strTBText = strTBText & ctrCB.List(ctrCB.ListIndex, ctrSpalte)
Set
ctrCB =
Nothing
End
If
Next
TB_fuellen = strTBText
End
Function