sammers101
Registered User.
- Local time
- Today, 10:34
- Joined
- May 11, 2012
- Messages
- 89
I am trying to do a loop that alters records as it goes. My tables are setup as Orders->OrderDetails. I have a currency field named ProfitPrice within OrderDetails.
Currently I have this working code using macros:
I want to add to this, soonce it has found an matching order I want it to edit that record's ProfitPrice Field. I tried the following code but it says The identifier OrderDetails.ProfitPrice could not be found
ProfitPrice will be a calculation using data from both the order table and the OrderDetails Table, but I was just testing it with 5.99
Currently I have this working code using macros:
Code:
pass parameter prmOrderID
SetLocalVar varOrderSubTotal = 0
For Each Record IN SELECT OrderDetails.OrderID, OrderDetails.ExtendedPrice FROM OrderDetails;
Where Condition = [OrderID]=[prmOrderID]
Set Local Var varOrderSubTotal=[varOrderSubTotal]+[ExtendedPrice]
SetReturnVar retOrderSubTotal=[varOrderSubTotal]
I want to add to this, soonce it has found an matching order I want it to edit that record's ProfitPrice Field. I tried the following code but it says The identifier OrderDetails.ProfitPrice could not be found
Code:
pass parameter prmOrderID
SetLocalVar varOrderSubTotal = 0
For Each Record IN SELECT OrderDetails.OrderID, OrderDetails.ExtendedPrice FROM OrderDetails;
Where Condition = [OrderID]=[prmOrderID]
Set Local Var varOrderSubTotal=[varOrderSubTotal]+[ExtendedPrice]
[COLOR="Blue"]Edit Record
SetField
OrderDetails.[ProfitPrice]=5.99[/COLOR]
SetReturnVar retOrderSubTotal=[varOrderSubTotal]
ProfitPrice will be a calculation using data from both the order table and the OrderDetails Table, but I was just testing it with 5.99