Combo Box with a Listbox

jsnyde57

New member
Local time
Yesterday, 16:35
Joined
Jan 2, 2013
Messages
5
I have a created a database of all of the IT vendors that we have tech support with. I created a search form with two different combo boxes (so our employees can select either the vendor from the list or select by the product). I keep hitting my head against the wall.

Private Sub Command9_Click()

RequeryList

End Sub


Private Sub RequeryList()

Dim Wh As String, Wh2 As String
Dim SQL As String
Dim X As Integer

If VendorName <> "" Then
If Wh <> "" Then Wh = Wh & " " & AndOrCombo & " "
Wh = Wh & " VendorName Like '*" & VendorName & "*'"
End If
If Not IsNull(ProductName) Then
If Wh <> "" Then Wh = Wh & " " & AndOrCombo & " "
Wh = Wh & "ProductName=" & "ProductName"
End If



If Wh = "" Then
MsgBox "Enter at least one parameter value."
Exit Sub
End If

SQL = "SELECT ID,VendorName,Contact Number," & _
"Product FROM Contact Numbers Query WHERE" & Wh
VendorList.RowSource = SQL

I know that I am missing something small, which is even more frustrating.
 

Users who are viewing this thread

Back
Top Bottom