Show all Records

B

Bob Vance

I am using a combo box to filter my records in a List Box
*2 problems the combo box is showing say "Transport" 6 times if I have
transport in that field 6 times (No Duplicates Please)
*When I select Transport it only shows 1 field, I am trying to get the list
box to show all 6 fields (Show Duplicates)

Combobox=
Private Sub cmbFindSubject_AfterUpdate()
Me!lstModify.RowSource = "SELECT * FROM qryClientInvoice Where [InvoiceID]
Like " & Me.cmbFindSubject

End Sub

Query=
SELECT tblInvoice.InvoiceID, tblInvoice.ClientDetail
FROM tblInvoice
WHERE (((tblInvoice.ClientDetail) Is Not Null));
 
S

Stefan Hoffmann

hi Bob,

I am using a combo box to filter my records in a List Box
*2 problems the combo box is showing say "Transport" 6 times if I have
transport in that field 6 times (No Duplicates Please)
You need to modify you query. Use DISTINCT, DISTINCT ROW or a GROUP BY
clause. btw, specifiy the field names in your select, don't use the
asterik, e.g.

Dim Subject As String
Subject = "'" & Replace(cmbFindSubject.Value, "'", "''") & "'"
lstModify.RowSource = "SELECT DISTINCT fieldList " & _
"FROM [qryClientInvoice] " & _
"WHERE [InvoiceID] LIKE " & Subject
*When I select Transport it only shows 1 field, I am trying to get the list
box to show all 6 fields (Show Duplicates)
Sorry, I don't understand what you mean.


mfG
--> stefan <--
 

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

Similar Threads

Not finding Records 1
Union Query Help 5
Change Order on a Report! 2
Cant find subForm 5
Need to add 1 Field to query! 5
combo box filter 1
combobox question 3
Filter tabular form by combo box 0

Top