473,385 Members | 1,535 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,385 software developers and data experts.

How do I create subtotals on a form that relate to values selected on a list?

I have an unbound listbox (list1) on my form.
Another unbound listbox (list2) that shows the totals of the values in the months in (list1)
I am trying to add a third listbox (list3) that subtotals the selected items in (list1)

I have multi-select set to extended to allow the multiselection.

I suspect I need to code something with the listindex and itemsselected?

Was hoping to copy (list2) query and add a filter using listindex, but can't get my head around that.

Would put my code on here, but there is an awful lot more going on in this form, and it would probably complicate things...and my coding is untidy !!! lol
Jan 27 '10 #1
3 2198
nico5038
3,080 Expert 2GB
I would simplify things by adding a YesNo field to the table. This enables the user to select rows without the CTRL pressed and thus "more stable" (a simple click can undo such a multiselect :-( ).

Having the YesNo field will easily allow you to total the rows by adding the YesNo field to be True.

You could even add a (de-)select all button that performs an UPDATE of the YesNo field for all rows in the table.

When you check my Left/Right listbox sample (http://bytes.com/attachments/attachm...tright2000.zip) you can see how I use such a field to determine in what listbox a row has to appear and by the > and >> buttons how the UPDATE is handled.

Getting the idea ?

Nic;o)
Jan 28 '10 #2
Hi Nico,
Thanks for the response. I get the idea, and have downloaded and looked at your code (which I may use elsewhere!) but I'm not sure as I can get this to practically work for my requirements. What I am after is similar to Excel where you have the "quick sum" ability in the bottom right hand corner in the status bar. You can easily and quickly hold down control/Shift and select multiple non-adjacent cells and see the sum instantly, but affect nothing structurally. (Stability is not an issue, as it is only meant to be a quick and dirty calc. to save time.) This access application I am building will be used in an active meeting, and will be fast paced, so speed is required even if I have to work on some more complicated code. Any other angle or a way you can think of?

Thanks for your thoughts so far.
MidgeY2K
Jan 29 '10 #3
nico5038
3,080 Expert 2GB
The YesNo field approach can be used for a quick sum by using an unbound field with a DSUM like:
Expand|Select|Wrap|Line Numbers
  1. =DSUM("MyNumericValue","MyTable","YesNo=True")
  2.  
The other solution would be to loop in code through the SelectedItems of the listbox and sum them in code.

Nic;o)
Jan 30 '10 #4

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

Similar topics

2
by: Jefferis NoSpamme | last post by:
Hi folks, Trying to fill in a gap in my understanding of php, and so this is rather newbish: I have created a form where a user selects 2 items from a list of 8 values. That form field is...
2
by: Nick | last post by:
Loop to create an array from a dynamic form. I'm having trouble with an application, and I'll try to explain it as clearly as possible: 1. I have a form with two fields, say Apples and...
5
by: Nick Calladine | last post by:
Learning : Loop to list all dropdown box values on a form Can some one point me in the right direction : I have a form which I want to loop through I basically want to get all the selected...
10
by: Mr Newbie | last post by:
DropDown lists and Listboxes do not appear in the list of controls and values passed back to the server on PostBack in Request.Form object. Can someone confirm this to be correct and possibly...
3
by: S P Arif Sahari Wibowo | last post by:
Hi! I would like to make an editable continous form, where most fields will be from table A and editable, except 1-3 fields are a glimpse into table B and uneditable. Table A relate to table B...
2
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
10
by: SM | last post by:
Hello I'm trying to create a multi dimensional array in JavaScript, but after some reading i still can't figure out how to apply it to my model. Here it is: I have a list A and for each item...
1
by: morangi | last post by:
<?php session_start(); error_reporting(E_ERROR && ~E_NOTICE && ~E_WARNING); ob_start(); $link = mysql_connect('localhost', 'root', 'test'); if (!$link) { die('Could not connect: ' ....
3
by: creative1 | last post by:
Here is how you create a complex data report that involves parent and child commands and you can update information at runtime. Its pretty straight forward to work with simple queries; however,...
2
by: ravisuguna | last post by:
Hi, I have a php page which has some checkboxes ,textfields and values.If I select a checkbox ,a particular value will be displayed in a textfield.I have a "go"button in the same page.I want the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.