Feb 24th, 2005, 10:31 PM
#1
Thread Starter
Addicted Member
Total of subform fields
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
Feb 24th, 2005, 10:40 PM
#2
Re: Total of subform fields
Is "Total Amount" on the main form or subform?
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 25th, 2005, 02:07 AM
#3
Thread Starter
Addicted Member
Re: Total of subform fields
Total Amount field is in the main form
Feb 26th, 2005, 12:49 PM
#4
Re: Total of subform fields
Try setting the conttrolsource for the Total Amount field equal to a sum statement
of the field in concer in the subform.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 26th, 2005, 09:11 PM
#5
Thread Starter
Addicted Member
Re: Total of subform fields
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.
Feb 26th, 2005, 11:23 PM
#6
Re: Total of subform fields
Could you attach a small screen shot showing the details.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 27th, 2005, 12:24 AM
#7
Thread Starter
Addicted Member
Re: Total of subform fields
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.
Attached Files
Feb 27th, 2005, 11:48 AM
#8
Re: Total of subform fields
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 27th, 2005, 09:09 PM
#9
Thread Starter
Addicted Member
Re: Total of subform fields
Here is the attched db. Please feel free to make any changes you like.
Attached Files
Feb 27th, 2005, 09:40 PM
#10
Re: Total of subform fields
Ok, I got it on my system now. I will look into it.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Mar 2nd, 2005, 11:58 AM
#11
Thread Starter
Addicted Member
Re: Total of subform fields
Hello there,
any updates?
please this is urgent
Mar 2nd, 2005, 02:48 PM
#12
Junior Member
Re: Total of subform fields
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.
Mar 2nd, 2005, 09:00 PM
#13
Thread Starter
Addicted Member
Re: Total of subform fields
Hello there,
Yes it is necessary to save th total amount in the master table. Please help me in this.
Regards,
Piyush
Mar 2nd, 2005, 10:37 PM
#14
Re: Total of subform fields
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.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width