Solved

Access 2007 Form

Posted on 2013-05-17
6
372 Views
Last Modified: 2013-05-17
I have a form with a combo box, source Table has last name only. When I add new names, who do I get the list to sort A-Z in order.

I went into the table itself and sorted A-Z but it doesnt change the list in the combo box list in the form.
0
Comment
Question by:CMILLER
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 200 total points
ID: 39175395
Change the Combobox Rowsource property  to sort in the order you want:

SELECT LastName
FROM YourTable
ORDER BY LastName
0
 
LVL 48

Expert Comment

by:Dale Fye
ID: 39175410
Depending on how you are adding a name, you may also need to requery the combobox after adding the name.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39175441
..A bit more info:

By default if you do not specify a Sort for Ascending (A-->Z)

But to be more correct, you can do this:
SELECT LastName
FROM YourTable
ORDER BY LastName ASC

Or this for Descending (Z-->A)
SELECT LastName
FROM YourTable
ORDER BY LastName DESC

JeffCoachman
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39175450
Yes,
fyed has a good point.

To requery the combobox, do something like this.

Me.YourCombobox.Requery
0
 

Author Comment

by:CMILLER
ID: 39175696
I added ORDER BY LastName and that worked.

Thanks.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39175770
great!

Enjoy the weekend

;-)

JeffCoachman
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question