sorting a form

  • Thread starter Thread starter Randy
  • Start date Start date
R

Randy

I have a form linked to a table (tblassignment). The
form has two data elements, account number(acctsub) and
person assigned to the account. The person assigned is a
standard select statement, and the combo box is named
combo13

SELECT DISTINCTROW [EmployeeTbl].[EmplID], [EmployeeTbl].
[Last Name], [EmployeeTbl].[First Name] FROM
[EmployeeTbl];

In the forms property box sort field I have the following
Lookup_Combo13.[Last Name]
and when I open the form, employee adams is first,
employee Barnes is second etc. But if adams has 8
different accounts assigned to him, the accounts are not
ordered. So I added a second sort. However it did not
work

I add a second sort as follows
Lookup_Combo13.[Last Name];[acctsub]

now when I open the form, it is sorted by acctsub,
ignoring the first sort parameter. If I leave off the ;
[acctsub] it sorts by last name just fine.

What am I missing?
 
The easiest way is to do an Order By clause in the SELECT
statement.

SELECT DISTINCTROW [EmployeeTbl].[EmplID], [EmployeeTbl].
[Last Name], [EmployeeTbl].[First Name] FROM
[EmployeeTbl] ORDER BY [Last Name],[First Name];


Chris
 
Back
Top