Solved

Access 2007 Form

Posted on 2013-05-17
6
329 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
  • 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 47

Expert Comment

by:Dale Fye (Access MVP)
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now