473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

calculating totals within a listbox

I currently have an order form, where a customer can place order for items and each time they select a product and quantity then add button, this adds the item to the listbox with the quantity total for each item.

for example quantity= 10 * 19.99each the total 199.99 for each line will be displayed, i could get this to work so it adds the the total for each line to the listbox.
but then i want to add all the totals up for this particular order from the listbox and display it within a textbox as the overall total which i have called =txttotalcost

for example:

product ID, Name, quantiy, item price, totalcost
P0001 Top 5 1.00 5.00
P0002 Top 4 2.00 8.00
P0003 Top 3 1.00 3.00


i then have a text box where i want to display the total for these items within. hope this helps. im really stuck on this one!!!

Any ideas?
Jan 28 '08 #1
3 4050
I currently have an order form, where a customer can place order for items and each time they select a product and quantity then add button, this adds the item to the listbox with the quantity total for each item.

for example quantity= 10 * 19.99each the total 199.99 for each line will be displayed, i could get this to work so it adds the the total for each line to the listbox.
but then i want to add all the totals up for this particular order from the listbox and display it within a textbox as the overall total which i have called =txttotalcost

for example:

product ID, Name, quantiy, item price, totalcost
P0001 Top 5 1.00 5.00
P0002 Top 4 2.00 8.00
P0003 Top 3 1.00 3.00


i then have a text box where i want to display the total for these items within. hope this helps. im really stuck on this one!!!

Any ideas?
Hi Goldstar,

Have a look at this post. I placed the code in the AfterUpdate event of the list box.
As Missing Linq suggests, it might be better to use a subform for this, but this will do what you are asking for.

Kind Regards,
Ken Farrawell
Jan 29 '08 #2
Hi Goldstar,

Have a look at this post. I placed the code in the AfterUpdate event of the list box.
As Missing Linq suggests, it might be better to use a subform for this, but this will do what you are asking for.

Kind Regards,
Ken Farrawell
Thanks Ken, Works a charm!!!

Just a quick query i am planning to have an edit button, that will allow records already within the text box to be edited, if so and that record is edited or deleted would the total change with the same code?
Jan 29 '08 #3
Thanks Ken, Works a charm!!!

Just a quick query i am planning to have an edit button, that will allow records already within the text box (list box?) to be edited, if so and that record is edited or deleted would the total change with the same code?
Hi Goldstar,

I'm assuming that by text box you mean the list box. Because the code is in the afterupdate event the total will be recalulated every time there is a change to it, so the answer is yes.

Kind Regards,
Ken Farrawell
Jan 29 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: The Bit Bandit | last post by:
Hopefully someone can help me create a query that I'm having some trouble with. I have three tables: invoices, invoicedetails, invoicepayments The fields are: invoices -------- InvoiceNo
25
by: kie | last post by:
hello, i have a table that creates and deletes rows dynamically using createElement, appendChild, removeChild. when i have added the required amount of rows and input my data, i would like to...
3
by: Paul Mendez | last post by:
Performance_Date SumOfBudget_NOI CurrYTD_BudgetNOI_Total 1/1/2004 $4,184,626.00 ? 2/1/2004 $4,484,710.00 ? 3/1/2004 $4,537,424.00 ? 4/1/2004 ...
2
by: mhodkin | last post by:
I created a query in which I have grouped data by City. I wish to calculate the percent of each value, e.g. City/(Total count of all Cities), in tbe next column of the query. I can't seem to...
2
by: Tim Marshall | last post by:
Wondering if anyone has any suggestions for this. Sometimes in the form reports my users run, a data sheet subform on a main form, with totals in text boxes with calculated controlsources...
5
by: jonm4102 | last post by:
I'm trying to calculate the median of some numerical data. The data can only be found in a query (henceforth query 1) field I previously made, and I would prefer to calculate the median in a new...
10
by: rdemyan via AccessMonster.com | last post by:
I have a subform that displays around 10 fields. Most of the values shown result from some complex calculations. To make it easy, I have stored the results in a temporary table and then all I...
2
by: mtchampi | last post by:
Hello all, I have a limited SQL background, and I am responsible for creating a monthly report that displays separate tables for the following: 1. Calculate individual monthly totals of files...
38
by: d0ugg | last post by:
I'm writing a program that will have to roll the dice A and dice B one million times, and calculate the percentage of times that the dies will be equal. I'm having trouble to figure out how the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.