PDA

Click to See Complete Forum and Search --> : Total of subform fields


pbuddy_8
Feb 24th, 2005, 09:31 PM
I have a Bill form and a transaction sub form. It is displayed like this:

Bill No Date


SNo. Particulars Rate Qty Amount




Total Amount


The sno, particulars etc are fileds of subform and all others are in main form. Now what I want is to calculate total of Amount and put it into Total Amount. How do I do this?

Regards,
Piyush

RobDog888
Feb 24th, 2005, 09:40 PM
Is "Total Amount" on the main form or subform?

pbuddy_8
Feb 25th, 2005, 01:07 AM
Total Amount field is in the main form

RobDog888
Feb 26th, 2005, 11:49 AM
Try setting the conttrolsource for the Total Amount field equal to a sum statement
of the field in concer in the subform.

pbuddy_8
Feb 26th, 2005, 08:11 PM
I have done that. But now there is one more problem. If you remember you told me to make a new form to display the comapny information and then place the bill form in it. Now when I use the code Forms("New_Bill").Controls("Orderkey").value = .... It says it can't find the form New_Bill. It only happens when the New_Bill form is in Main_NewBill form (the one which shows company info). Please help me with this.

RobDog888
Feb 26th, 2005, 10:23 PM
Could you attach a small screen shot showing the details.

pbuddy_8
Feb 26th, 2005, 11:24 PM
Here is the attached document. I've numbered the forms as 1,2 & 3 respectively. I'm also sending the Total Amount as parameter to a query which is set as datasource for the Invoice report. So that also isn't working. If you want I can send you the complete database. Please help me in fixing this.

RobDog888
Feb 27th, 2005, 10:48 AM
When your on-line today attach the db in zip format. Its going to be to difficult
for use to solve this way. I need to see and test it. :thumb:

pbuddy_8
Feb 27th, 2005, 08:09 PM
Here is the attched db. Please feel free to make any changes you like.

RobDog888
Feb 27th, 2005, 08:40 PM
Ok, I got it on my system now. I will look into it.

pbuddy_8
Mar 2nd, 2005, 10:58 AM
Hello there,

any updates?

please this is urgent

ivobenkovic
Mar 2nd, 2005, 01:48 PM
Hi...

I guess the code in the form is little bit messed up. However.
Is it necessary to save the calcluated total amount in the master table or is it "just a hack" to solve the problem?


by the way. you placed the validation rule in table company in the default value property.

pbuddy_8
Mar 2nd, 2005, 08:00 PM
Hello there,

Yes it is necessary to save th total amount in the master table. Please help me in this.

Regards,
Piyush

RobDog888
Mar 2nd, 2005, 09:37 PM
You should not be entering the BillAmt values to the orders table. They need to calculated and not stored.
So if a new item is purchased then the BillAmt will change acordingly. You can remove that field.

The update bill form does not total either. It just reads from the transaction table. Too much to try to fix at once.

I suggest creating a second new db and work it one object at a time. :(