Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / October 2005

Tip: Looking for answers? Try searching our database.

No Repeat Please

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kennykee - 27 Apr 2005 08:44 GMT
I have a combo box

But i dont want values in the list to be repeated eventhough the source has
same repeated value

eg source: "papaya", "banana", "apple", "papaya", "apple"

List i want to see is only "papaya", "banana", "apple" and not all.

Any Solution?

Thanks in adcance

KennyKee
Rob Parker - 27 Apr 2005 09:31 GMT
If the recordsource for the combo-box is a value list, simply remove the
duplicates from the list.  If the source is a table or query, include the
DISTINCT keyword in the SQL for the source; eg:
   SELECT DISTINCT Fruit FROM tblFruit ...

HTH,

Rob

> I have a combo box
>
[quoted text clipped - 10 lines]
>
> KennyKee
kennykee - 27 Apr 2005 09:42 GMT
You are totally correct
Thanks Very Much

> If the recordsource for the combo-box is a value list, simply remove the
> duplicates from the list.  If the source is a table or query, include the
[quoted text clipped - 20 lines]
> >
> > KennyKee
ETC - 29 Oct 2005 01:18 GMT
Hi Rob,

I tried this too, but it didn't work for me.

Here’s my DB info…

My table (named “X Codes”) has a field “Fac Loc”.  The column looks like the
following:

Fac Loc
C
B
C
A
B

How do I create a combo box that lists each type of "Fac Loc" in Ascending
order without repeating ones that are listed multiple times?  I tried using
DISTINCT, but I think I did the coding wrong.  Please use the Field and table
names I've provided.  I'm still a beginner and still trying to understand
coding.  Any help is much appreciated.  Thanks!

ETC

> If the recordsource for the combo-box is a value list, simply remove the
> duplicates from the list.  If the source is a table or query, include the
[quoted text clipped - 20 lines]
> >
> > KennyKee
Allan Murphy - 29 Oct 2005 08:46 GMT
Change DISTINCT to DISTINCTROW

Signature

Allan Murphy
Email: allanmurphy@unwired.com.au

> Hi Rob,
>
[quoted text clipped - 3 lines]
>
> My table (named "X Codes") has a field "Fac Loc".  The column looks like
the
> following:
>
[quoted text clipped - 37 lines]
> > >
> > > KennyKee
ETC - 31 Oct 2005 20:51 GMT
It worked!  Thanks, Allan.

> Change DISTINCT to DISTINCTROW
>
[quoted text clipped - 51 lines]
> > > >
> > > > KennyKee
Steve Schapel - 27 Apr 2005 09:36 GMT
KennyKee,

Is the Row Source of your combobox based on a table?  Instead, make a
query based on your table, and use this as the combobox's Row Source.
In design view of the query, right-click anywhere on the background of
the upper panel of the query design window, select Properties from the
pop-up menu, and then set the Unique Values property to Yes.  The SQL
view of the query will look something like this...
 SELECT DISTINCT Fruit FROM YourTable

Signature

Steve Schapel, Microsoft Access MVP

> I have a combo box
>
[quoted text clipped - 10 lines]
>
> KennyKee
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.