sorting combo box listed values

  • Thread starter Thread starter David Rose
  • Start date Start date
D

David Rose

I am totally new to Access 2003. I have created my first data entry form,
including a number of combo boxes. The combo boxes have a number of listed
values (two columns, with column 1 as the "two character" entry, for example
"PD" or "EA", and column 2 as a description). Some combo boxes have 20-30
choices. I read in 'Help' that Access should (I think) sort the column 1
entries, but it does not. How do I sort, please - and do remember I am a
virgin at this!
 
David,
I think your problem is that you are using a Table as the RowSource for
your combo box. If so, it will sort just the way the "raw" table does.
Use a query instead.
Place your cursor in the textbox for the combo's RowSource, and click the
"3 dot" button. That will put you into query design mode.
Add your table to the query, and the 2 fields/columns you want, and sort
the query "ascending" on your 2 character column.
 
Al,
Thank you for the speedy response. Apart from not knowing what I am doing, I
am not sure I have done what you suggest.
I have an underlying database into which I want to input information via the
form. That database does, of course, have a number of fields. The combo
boxes I created, with the Access wizard, simply have the information I have
typed in them, e.g. PR, Probation, PS, Prison Service (for columns 1,2,1,2).
The input will go into a particular field of the database, but how does this
help sort my combo box?
In case it is relevant, the combo box properties show the 'Row Source Type'
as "Value List" and the'Row Source' as "Pr;Probation;PS;Prison Service",
etc. When I right click the Row Source I do not get teh 3-dot button but a
drop down box with, as the second and only other row, the name of my
database. If I change the 'Row Source Type to 'Table/Query' then I will get
the 3-dot button in the 'Row Source' box, but at that point I am lost. If I
choose to "Add" my database I have a list of fields in the database but they
are not what I am after - I need the list that is column 1 of my combo box.
Could you point me further, please?
David.
 
Hi David,

Your only option for sorting a Value List based combo box is to enter the
values in alphabetical order. This is just one reason why value list are not
considered so versatile. Another reason is that if you need to add or remove
an item from the list, you'll need to open the form in design view.

If you create a new table, and add the values that are currently in your
value list, you will be able to easily apply a sort order. You'll also be
able to add and remove items from the combo box simply by adding or removing
records from a table.
If I change the 'Row Source Type to 'Table/Query' then I will get
the 3-dot button in the 'Row Source' box, but at that point I am lost.

Create your table first. Add the values from your value list. You'll likely
want to set the first column (the column with values like PR, PS, etc.) as
the primary key. Then go back and change the row source type to Table/Query
and click on the 3-dot button in the Row source box.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

:

Al,
Thank you for the speedy response. Apart from not knowing what I am doing, I
am not sure I have done what you suggest.
I have an underlying database into which I want to input information via the
form. That database does, of course, have a number of fields. The combo
boxes I created, with the Access wizard, simply have the information I have
typed in them, e.g. PR, Probation, PS, Prison Service (for columns 1,2,1,2).
The input will go into a particular field of the database, but how does this
help sort my combo box?
In case it is relevant, the combo box properties show the 'Row Source Type'
as "Value List" and the'Row Source' as "Pr;Probation;PS;Prison Service",
etc. When I right click the Row Source I do not get teh 3-dot button but a
drop down box with, as the second and only other row, the name of my
database. If I change the 'Row Source Type to 'Table/Query' then I will get
the 3-dot button in the 'Row Source' box, but at that point I am lost. If I
choose to "Add" my database I have a list of fields in the database but they
are not what I am after - I need the list that is column 1 of my combo box.
Could you point me further, please?
David.
 
Tom,

Many thanks for putting me right. You live and learn - even at my ripe,old
age!

David.
 

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

Back
Top