Solved

Access 2007 Form

Posted on 2013-05-17
6
340 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Unrecognized Database Format 8 94
Alter an update query which rounds 7 33
Storing Combo Box Selection in Table 12 45
Set focus on next field when character count = 5 9 12
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…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

862 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

25 Experts available now in Live!

Get 1:1 Help Now