Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.HideDuplicates syntax

Status
Not open for further replies.

KarlTrep

Technical User
Oct 30, 2000
5
CA
I have a combobox presenting the values from a field which has duplicate entries. I've found that there is a property that eliminates the duplicates from appearing in the combobox (.HideDuplicates) but I don't know how nor where to write this command.

All help appreciated
TIA

Karl Trepanier
 
I'll check to see if that works but for now to give you a quick solution;

in your query for this combo box use grouping to iliminate dups....

hope this helps....
 
for the SQL for the combobox, instead of using Select DistinctRow use Select Distinct


PaulF
 
I'm using Access 2000 and since I don't know VB and there is no option in the combobox wizard that does this, I would really appreciate something along the lines of:
Code:
Private Sub ComboBox6_BeforeUpdate(Cancel As Integer)
    Dim stDocName As String
    stDocName = "Customer name"
    *******************.HideDuplicates
    *************
    *************
End Sub
What is the code i'm missing to apply the .HideDuplicates property to my combobox and anything else I could be missing like "On Error ..." for example.

Thanks
KARL
 
Here I use this a lot

SELECT DISTINCTROW Tablename.field FROM Tablename GROUP BY Tablename.field;

So only one date will show for each date there.


DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
Hi Doug and Paul,

I've tried both DISTINCT and DISTINCTROW but my combobox shows a blank list (about as long as the complete list hmmm?)
Reading through the Access Help I found that DISTINCTROW is disregarded when only one table is looked up (as in my case)so I'll stick with DISTINCT.

This is what I've got typed into the combobox properties:
Code:
SELECT DISTINCT [TableInvoice].[Customer name] FROM [TableInvoice] GROUP BY [TableInvoice].[Customer name];
I've tried with and without brackets with no success.
I know we are close to nailing this.
Thanks for the help:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top