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

Top