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.
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]
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...
"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
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
"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.