List box

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
 
K

Klatuu

Can you restate your question?
You only show one query in your code, it is filtered, and it has only one
field. You are getting the results your code is written to produce. What
and where is this other filtered query you mention?
 
R

Rpettis31

I thought my code when I filted would still show all columns with the
filtered value.
I have one query to look by Customer items, I then would like to filter the
enter list by items by there type.
 
K

Klatuu

Sorry, but your response is so vague I can't determine what you are doing and
what the problem is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top