R
Rpettis31
I am trying to list values based on user selections based on filtering a
query, my code does not seem to be working properly. The list box seems to
only show the value in column one from this code rather than the query that
is filtered.
Private Sub Toggle20_GotFocus()
Dim InvType As String
Me.List8.RowSource = ("qryCustomer1")
InvType = InputBox("Please enter an Inventory Type or select ALL",
"Inventory Type")
Dim strRowSource As String
strRowSource = "SELECT ItemType FROM qryCustomer1"
If IsNull(Me!List8.Value) Then
' leave strRowSource unfiltered.
Else
' add a WHERE clause to the rowsource SQL statement.
strRowSource = strRowSource & _
" WHERE ItemType = '" & InvType & "'"
End If
Me.List8.RowSource = strRowSource & ";"
End Sub
query, my code does not seem to be working properly. The list box seems to
only show the value in column one from this code rather than the query that
is filtered.
Private Sub Toggle20_GotFocus()
Dim InvType As String
Me.List8.RowSource = ("qryCustomer1")
InvType = InputBox("Please enter an Inventory Type or select ALL",
"Inventory Type")
Dim strRowSource As String
strRowSource = "SELECT ItemType FROM qryCustomer1"
If IsNull(Me!List8.Value) Then
' leave strRowSource unfiltered.
Else
' add a WHERE clause to the rowsource SQL statement.
strRowSource = strRowSource & _
" WHERE ItemType = '" & InvType & "'"
End If
Me.List8.RowSource = strRowSource & ";"
End Sub