sorting a form

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?
 
C

Chris

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top