Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15107

[RESOLVED] Function parameter as element name

$
0
0
Hi and happy new year :D

I making a function to get the ComboBox ItemData value from ComboBox Text value.

Code:

Private Sub CmbJLabelFormat_Click()
        Call GetCmbItemData("CmbJLabelFormat", CmbJLabelFormat.Text)
End Sub

Private Sub GetCmbItemData(CmbName As String, CmbText As String)
    Dim i As Long
    For i = 0 To CmbName .ListCount - 1
        If CmbName .List(i) = CmbText Then
                  MsgBox CmbName .ItemData(i)
            Exit For
        End If
    Next
End Sub

I get error :
Compile error: Invalid qualifier

How can I define CmbName value as ComboBox name to look ?

Thanks :D
Couiiiinnnn :duck:

Viewing all articles
Browse latest Browse all 15107

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>