Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form not displaying data in ascending order

Status
Not open for further replies.

KerryL

Technical User
May 7, 2001
545
US
I'm having trouble displaying the results of a combo box selection on the form in alphabetical order.

On a form that is used for updating staff information I've placed a combo box. The combo box displays names from the staff table, listing them by last name alphabetically.

When I select a name from the combo box the appropriate employee record is found, which is fine. But the record following the name I picked from the combo box is not the next record (alphabetically). Instead, it's showing whatever record is next based on Staff ID, which is the key field in the table.

Example:

StaffID Last Name
100 Davis
101 Smith
102 Long
103 Dugan

The combo box sorts the names alphabetically, so they appear:
Davis
Dugan
Long
Smith

But after I select "Davis" from the combo box, the form displaying the records displays them in this order (by Staff ID, which is the key field):
Davis
Smith
Long
Dugan

I can't get the records to display in the detail section of the form in the same order (by last name) as they do in the combo box. Obviously the sort order on the form is based on the Staff ID number, but how can I override this?

I tried sorting my table in last-name ascending order, I tried modifying the query by removing the Staff ID column from the query. Neither worked.

If you can help I sure would appreciate it.

Kerry
 
Thank you tlbroadbent! I knew it had to be something fairly simple--guess I just wasn't aware of what the Order By field did. It's working fine now.

Thanks again,
Kerry

:) "Failure is the opportunity to begin again more intelligently." --Henry Ford
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top