Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re-Sort on masterfield?

2 views
Skip to first unread message

Terry Spall

unread,
Nov 5, 2001, 7:06:02 AM11/5/01
to
Hi

In the past the masterRowset/masterField link has worked perfectly fine in
the Data Modules for my applications.
Eg: Suppliers Table and Orders Table: the link is the Supplier Number, and
because the Order Numbers are created in numerical order, the list of orders
by supplier looks fine.

I now have a new problem. I have a table of suppliers, and I have a table of
stock items. The stock items are not in any particular order. The link
between the two tables is a supplier number. I view the tables in two grids
but I cannot get the stock items into part number order as the masterField
is set to SupplierNo to link to the supplier table, (change the masterField
and I lose the link).

If I haven't bored you yet............

Is there any way I can list my Stock Items in Part number order?

Thanks

Terry Spall.

Todd Kreuter [dBVIPS]

unread,
Nov 5, 2001, 7:37:24 AM11/5/01
to
Terry Spall wrote:
>
> I now have a new problem. I have a table of suppliers, and I have a table of
> stock items. The stock items are not in any particular order. The link
> between the two tables is a supplier number. I view the tables in two grids
> but I cannot get the stock items into part number order as the masterField
> is set to SupplierNo to link to the supplier table, (change the masterField
> and I lose the link).
>
> Is there any way I can list my Stock Items in Part number order?

If wanting to maintain the masterRowset/Fields link based on the
supplier number, you simply need to add the 'Part Number' to the index
expression in the stock items table. That will sort the stock items by
part number, for each supplier.

SupplyLinkA = "SupplierNo + PartNo"

--
Todd Kreuter [dBVIPS]

Terry Spall

unread,
Nov 5, 2001, 9:39:07 AM11/5/01
to
Thanks for replying Todd,

It all sounded so easy, I think I left my brain at home today.
Unfortunately I cant get it to work. (The datamodule - not my brain)
I created a new index in the stock table SupplierLinkA =
str(supplierno)+supplierpart.
It won't let me use SupplierLinkA as the index in the DataModule if I'm
using the supplierNo as the masterField.
And it won't let me enter indexname = "str(supplierno) + supplierpart" in
the datamodule either.
Sorry to be a pain, but if I can get this to work I'll be happy forever
(well, until the end of the day at least!)
Thanks

Terry

Todd Kreuter [dBVIPS] <dBV...@usa.net> wrote in message
news:3BE68804...@usa.net...

Marko Mihorko [dBVIPS]

unread,
Nov 5, 2001, 10:12:54 AM11/5/01
to
Hello Terry!

"Terry Spall" je napisal v sporočilo...

> I created a new index in the stock table SupplierLinkA =
> str(supplierno)+supplierpart.
> It won't let me use SupplierLinkA as the index in the DataModule if I'm
> using the supplierNo as the masterField.

In that case you must create a calculated field in the master table's onOpen
event and assign that one to the child rowset's masterField property.

function your_parent_table1_onOpen
local f
f = new field()
f.fieldName = 'SupplierNo_calc'
f.beforeGetValue = {||str(this.parent['supplierNo'].value)}
this.rowset.fields.add(f)
return

Marko Mihorko [dBVIPS]

Presernova druzba d.d.
dBASE, Inc. International Partner
http://www.prdr.com/dbase


Terry Spall

unread,
Nov 5, 2001, 11:22:46 AM11/5/01
to
Thanks Marko - it worked - as you knew it would.

I just need to read the help file section on beforeGetValue to understand
it.

I feel just like a DiamondBack fan, - they didn't think they could do it,
but the team came through in the end!!!.

Thanks again

Terry Spall
SPC Plus
England

Marko Mihorko [dBVIPS]

unread,
Nov 5, 2001, 11:43:26 AM11/5/01
to
Hello Terry!

"Terry Spall" je napisal v sporočilo...

> Thanks Marko - it worked - as you knew it would.

Yes, I did. So as I understood because of that you will be happy forever (for
the rest of the day ;-).

> I feel just like a DiamondBack fan, - they didn't think they could do it,
> but the team came through in the end!!!.

Yes, of course, Todd gave his share here, too. ;-)

> Thanks again

You are welcome.

0 new messages