If the purpose of your form is to simply display the sales info, then:


01. Create a VIEW, such as SalesDataByCompany

Simple Example (Using Concomp Customer and TransMaster Tables):

        SET ERROR MESSAGE 677 OFF
        DROP VIEW SalesDataByCompany
        SET ERROR MESSAGE 677 ON
        CREATE VIEW `SalesDataByCompany` AS  +
        SELECT t1.Company,t2.CustID,t2.TransID,t2.EmpID,t2.TransDate, +
        t2.NetAmount,t2.Freight,t2.Tax,t2.InvoiceTotal +
        FROM TransMaster t2,Customer t1 WHERE t1.CustID = t2.CustID +
        ORDER BY t1.Company = A
        COMMENT ON TABLE `SalesDataByCompany` IS 'Sales Data by Company'
        RETURN

02. Associate your form (with region) based on that view.

03. EDIT USING FormName ORDER BY Company ...

Good Luck!

Very Best R:egards,

Razzak.


At 02:24 PM 6/18/2003 -0700, Gary Winzeler wrote:


With the Company table as the master table you then only see one
company at a time.

Which only provides for the region to see one companies sales at a
time, vs what I would like - all the sales for the month ordered by
company name.

At 04:32 PM 6/18/2003 -0400, you wrote:

At 12:40 PM 6/18/2003 -0700, Gary Winzeler wrote:

Using Windows 6.5++ Ver 1.866xRT03 Is there any way to order rows
in a single table form with a region based on a column in another table.

Here is what I have:

Company table
cid integer  - Unique id
cname (company name text 30)
...

Sales table
cid  integer
...

I need to edit data in the sales table only -
Edit form is single table based on the sales table and I would like to
order by cname,  I would rather not add the column to the sales table.


Gary,

Yes, you CAN!

01. Copy that form and use the Company as Master Table.

02.     In Form Designer, Add Sales table as Slave table and then
        set Sales as your current table.

Create a region with everything based on Sales table.

        Note: You don't need to locate any field or anything related to
        Company table, etc. on that form.

03.     EDIT USING SalesData +
        ARRANGE Sales BY OrderDate ASC +
        ORDER BY CName

That will give the results you need.

        All records will be sorted by CName (table=Company)
        along with the OrderDate (table=Sales).

or simply:

EDIT USING SalesData ORDER BY CName

Hope that helps!

Very Best R:egards,

Razzak.



Reply via email to