Summing the data in specific field in subform and display result to main form.
Sir,
I have a sub form named Request_Parts with fields customer_request_id, part number, Part name, retail price and serial number.
I have a main form which contains total price.
My requirement is that I need to get sum of the retail prices(sub form) in total price(main form).
I am using bi-directional relationship with the child and parent table.
I have used the following code. but, i am unable to save the code because of the highlighted portion.
total1 = 0;
for each row in
input.Request_Part
{
total1 = (total1 + row.Retail_Price);
}
input.Total_Price = total1.toString();
show Total_Price;
disable Total_Price;
Please help me to solve this.