How can be change the following instruction in VBA Excel to read values (instead of text) from a ComboBox ( cmbDiameter). This way works for text but for values gives an error.
If cmbDiameter.Text <> "" Then
If cmbItem.Text <> "" Then
strSQL = strSQL & " AND [Diameter]='" & cmbDiameter.Text & "'"
Else
strSQL = strSQL & " [Diameter]='" & cmbDiameter.Text & "'"
End If
End If
Thanks in advance
If cmbDiameter.Text <> "" Then
If cmbItem.Text <> "" Then
strSQL = strSQL & " AND [Diameter]='" & cmbDiameter.Text & "'"
Else
strSQL = strSQL & " [Diameter]='" & cmbDiameter.Text & "'"
End If
End If
Thanks in advance