• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 387
  • Last Modified:

Access 2007 Form

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
CMILLER
Asked:
CMILLER
  • 4
1 Solution
 
Jeffrey CoachmanMIS LiasonCommented:
Change the Combobox Rowsource property  to sort in the order you want:

SELECT LastName
FROM YourTable
ORDER BY LastName
0
 
Dale FyeCommented:
Depending on how you are adding a name, you may also need to requery the combobox after adding the name.
0
 
Jeffrey CoachmanMIS LiasonCommented:
..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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Jeffrey CoachmanMIS LiasonCommented:
Yes,
fyed has a good point.

To requery the combobox, do something like this.

Me.YourCombobox.Requery
0
 
CMILLERAuthor Commented:
I added ORDER BY LastName and that worked.

Thanks.
0
 
Jeffrey CoachmanMIS LiasonCommented:
great!

Enjoy the weekend

;-)

JeffCoachman
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now