Quick Help on Combo

Excel_Kid1081

Registered User.
Local time
Today, 01:50
Joined
Jun 24, 2008
Messages
34
Hello-

I have the following code I am using in a form that flows into an SQL structure to filter data:

If Not IsNull(Me.cboInternalRating) Then
strWhere = strWhere & "([Internal_Rating] = """ & Me.cboInternalRating & """) AND "
End If

My problem is when I run the combo and look at the results in the Immediate window it is returning the numeric value of the selected item instead of its text value. For example, the user chooses from the combo an internal rating of 'A' but the value being recognized in VBA is 1, which is its relative position in the combo box.

Any ideas on how I can correct this to get the 'A' value instead of the numeric? I need the 'A' value to filter in the SQL statement.

Thanks!

EK
 
Is this any better? It sounds like your picking up the unique ID for each record.
Code:
If Not IsNull(Me.cboInternalRating) Then
strWhere = strWhere & "([Internal_Rating] = """ & Me.cboInternalRating.Column(1) & """) AND "
End If
 
Got it...needed to be Me.cboInternalRating.Column(0)...thanks for the idea! Helped big time!
 

Users who are viewing this thread

Back
Top Bottom