Sorting Data

B

Basharat A. Javaid

As a sub-contractor, I have a number of clients (main client) for whom I
work on multiple end-clients (sub clients) for each main client.

Instead of having two (or multiple) tables - one for the main clients names
and then for the sub-clients I opted for a single table containing Clients'
names and sub-clients of the clients. So I have duplicates in the
ClientName field with non-duplicate sub-clients.

ClientA sub-client1
ClientA sub-client2
ClientB sub-client1
ClientB sub-client2

and so. The records in the table are sorted by main client's name and then
by sub-client's last name.

I created a form to view the data in the table. When I view the data with
the form, the records show up sorted as in the underlying table.

I then created a Macro to open the same form but filter the records by
certain criteria but this time the records don't show up sorted as in the
underlying table!?

Question - why is the sort order is lost?

In the macro, the available option is to sort by "one" field!? Can this be
extended to sort by two or more fields?

Thanks for the help.
 
D

Douglas J. Steele

Think of the data in tables in relational databases as being in "sacks":
relational database theory does not include the concept of "order" for the
data. If the order is important, you must use a query with an ORDER BY
clause in it as the data source for the form.
 

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