meganrobertson22@hotmail.com (Megan) wrote in message news:<5c14c12b.0406211024.5de919ce@posting.google. com>...[color=blue]
> Hey-
>
> Thanks for your suggestions and time! I truly appreciate it!
>
> If you don't mind, I'd like to pose this follow-up hypothetical
> situation...
>
> 1.) What if I add "All" to my table, tblMusicTypes,
>
>
> tblMusicTypes:
>
> MusicID | MusicDesc
> 1 Alternative
> 2 Pop
> 3 Rock
> 4 All[/color]
Megan,
The idea behind using the Union Query was to make the word "All"
available without putting it in the table. Sometimes the criteria for
filling a combobox is more complicated than in your case and being
able to add "All" without putting it in a table is desirable. The
Union Query also allows you to put the word "All" at the beginning or
at the end of the combobox regardless of the alphabetic order that
would normally result. You could also get "All" from the table in the
spot you want by including an "ORDER BY MusicID" clause in the SQL
statement used as a RecordSource for the combobox and swapping
MusicDesc values to get the desired order.
[color=blue]
>
> 2.) Use this SQL statement:
>
> SELECTMusicID, MusicDesc FROM tblMusicTypes UNION SELECT NULL AS
> AllChoice, "(All)" AS cboAll FROM tblMusicTypes;
>[/color]
If you don't put the word 'All' in tblMusicTypes then you can use
something like:
SELECT 'All' As MusicDesc, 0 As MusicID FROM tblMusicTypes UNION
SELECT MusicDesc, MusicID FROM tblMusicTypes ORDER BY MusicID;
to use the MusicID to get the desired list order or:
SELECT 'All' As MusicDesc FROM tblMusicTypes UNION SELECT MusicDesc
FROM tblMusicTypes ORDER BY MusicDesc;
to have 'All' as the first entry followed by the rest of the
selections alphabetized.
Hope this helps (hypothetically :-)),
James A. Fortune
[color=blue]
> "I'll be Baaack!" :-)
>
> Thanks All!
>
> Megan[/color]