Solved

Access 2007 Form

Posted on 2013-05-17
6
363 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 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

756 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