How to order a sub table?

  • Thread starter Thread starter Min
  • Start date Start date
M

Min

Hi, There is a main table, Clients, the key is ClientID. And there is a sub
table, Invoices, ClientID is the foreign key in table Invoices.

Now, I need order the Invoice table by ClientName. How can I do this?

The problem is I cannot use a joint query which including fields from
Clients, because the joint table must contain all records in Clients, this
makes the query cannot be used to add new Invoice.
 
Change the record source for the subform to a query. The query should have only
one table (Invoices). Add all of the fields except the primary key field (if it
is an Autonumber type). In the grid, for the ClientName column, change the Sort
row to Ascending.

You will still be able to add new Invoices using the query instead of the table.


Steve
 
The problem is the ClientName is in table Clients. If I need ClientName, I
have to include Clients in the query.
 
If the main form record source is Clients and the sub-form record source is
Invoices, linked by ClientID, when you select a client in the main form, only
the invoices for that client will be displayed in the sub-form.

I would base both the main form and the sub-form on queries rather than tables.

If you select one client and the sub-form shows only invoices for that client,
why do you want the sort the invoice table by client name?

Sorry if I still don't understand....

Steve
 
Well, the situation is on the form of Invoice, there are many invoices to be
created. Before the creation of invoices, the user want to check each
invoice to find anything wrong to compare with data on a spread sheet which
is sort by ClientName. In such case, the Main-Sub form is not suitable, I
think. The only thing I can do is do not use any bound control, instead use
pure code, if there is no way to sort Invoices table by ClientName.
 
Back
Top