All

  • Thread starter Thread starter The User
  • Start date Start date
T

The User

Using a combo box Access 2002 which gives a list of towns would like to have
the 1st entry to show All - any guidance as to how this could be done would
be appreciated

Thnaks in advance
 
-----Original Message-----
Using a combo box Access 2002 which gives a list of towns would like to have
the 1st entry to show All - any guidance as to how this could be done would
be appreciated

Thnaks in advance


.
 
Sorry about the blank post there, hit the wrong key
somehow.

You need to do a UNION query where you union on the "All"
value. I recommend using "(All)" rather than "All"
because it will sort at the top of the list.

To do a UNION query, you need to go to SQL View (View
menu, then SQL View and manually edit the query.

SELECT tblTowns.TownID, tblTowns.TownName
FROM tblTowns;

UNION SELECT 0, "(All)"
FROM tblTowns;
 
SELECT tblTowns.TownID, tblTowns.TownName
FROM tblTowns;

UNION SELECT 0, "(All)"
FROM tblTowns;

Anne,
Just a slight correction to that. Remove the semi-colon from the first
select statement.

SELECT tblTowns.TownID, tblTowns.TownName
FROM tblTowns
UNION SELECT 0, "(All)"
FROM tblTowns
ORDER BY 1;

The Order By clause will cause "All" to bubble to the top.
 
Hey Lynn -

Of course, you're definitely right, the ; doesn't belong.
But oddly, Access ignores it and it works OK at least in
Access 2000.

good catch on the sorting.

- A.
 
Of course, you're definitely right, the ; doesn't belong.
But oddly, Access ignores it and it works OK at least in
Access 2000.

Anne,
Well, Access does have it's oddities. I'm so accustomed to writing SQL in
Oracle that I never realized that Access would ignore the semi-colon.
 
Back
Top