Set Field may or may not be needed and you may need more steps than just Set Field. You may, in fact, not need any script at all. It depends on the design of your database. Do both layouts refer to the same table occurrence (box in your relationship graph)? If not, are they related? How?
Well there both related by invoice number and line items what im trying to do is get the total discount number from 1 box in my Category discount layout and then pull it to another box in my invoice layout.
"Well [They're] both related by invoice number and line items"
Sorry but that's just a bit vague. Exactly how are they related? (What fields in one table match to fields in the other?)
Does a record in the category discount table compute the discount? A flat fee discount? A percentage? Is it computed based on total sales for the current invoice?
I think you have at least three tables involved here but could be wrong:
The Category ID_invoice subtotals Order totals pretty much everything in the line items table
That doesn't really answer my questions and generates new ones:
What is Category ID_Invoice? A field? A table?
If it's a field, how is it defined?
If it's a table, what's the relationship like that links it to line items?
Ok i mean the things that both layouts share is
ID_invoice---<Lineitems>---- Category discounts
Both are linked with the ID_invoice the discount layout is category summary that gives me the subtotals for each category then i have a discount lin that discounts from that subtotal. at teh trailing grand summary i have a total discount box which is a summary field that totals the discounts for all the category. now what i want to do is pull that number into my invoice page so i can use it to minus the grand total and get my new grand total
Still not totally clear here.
Are these the relationships that you have?
Invoices::InvoiceID = LineItems::InvoiceID
CategoryDiscounts::InvoiceID = LineItems::InvoiceID AND
CategoryDiscounts::Category = LineItems::Category.
I've deliberately not talked in terms of layouts as that's yet another detail that can't be dealt with until I understand the specific details of how you've linked your tables.