Sum values in listbox?

  • Follow


In one of my db's (A2003) I have a listbox that displays CurrentDate,
CompanyName, CountOfInvoices, SumOfInvoices. I'm wondering If there is
a way to display a sum of all the items in, for example, Column(2) and
(3) of the list box to get a grand total.

 Right now I'm using a separate list box to display the values I want,
which works fine, so mostly I'm just curious. I couldn't figure out a
way to do it, but maybe I'm just being a meat head and overlooking
something.

Any ideas?

TIA

(is meat head one word or two?)
1
Reply Beetle 1/18/2008 6:21:22 PM

I have not tried this, but I had an idea that maybe using a Union query as 
the row source of the list box.  Union another query that would Sum the 
values for your.
Just a spurious thought.
-- 
Dave Hargis, Microsoft Access MVP


"Beetle" wrote:

> In one of my db's (A2003) I have a listbox that displays CurrentDate,
> CompanyName, CountOfInvoices, SumOfInvoices. I'm wondering If there is
> a way to display a sum of all the items in, for example, Column(2) and
> (3) of the list box to get a grand total.
> 
>  Right now I'm using a separate list box to display the values I want,
> which works fine, so mostly I'm just curious. I couldn't figure out a
> way to do it, but maybe I'm just being a meat head and overlooking
> something.
> 
> Any ideas?
> 
> TIA
> 
> (is meat head one word or two?)
> 
0
Reply Utf 1/18/2008 6:30:00 PM


Thanks Dave. I hadn't thought of that, but I'll try that when I get a chance. 
It's not a big deal, but right now my form loads a little bit slower than I'd 
like and I think it's because I have 4 list boxes, so I'm just looking at 
alternatives.

As usual, there is nothing "meatheadish" about your advice.

meatheadish - that's a word right?
Note to self: find a dikshunairee ;-)

-- 
_________

Sean Bailey


"Klatuu" wrote:

> I have not tried this, but I had an idea that maybe using a Union query as 
> the row source of the list box.  Union another query that would Sum the 
> values for your.
> Just a spurious thought.
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "Beetle" wrote:
> 
> > In one of my db's (A2003) I have a listbox that displays CurrentDate,
> > CompanyName, CountOfInvoices, SumOfInvoices. I'm wondering If there is
> > a way to display a sum of all the items in, for example, Column(2) and
> > (3) of the list box to get a grand total.
> > 
> >  Right now I'm using a separate list box to display the values I want,
> > which works fine, so mostly I'm just curious. I couldn't figure out a
> > way to do it, but maybe I'm just being a meat head and overlooking
> > something.
> > 
> > Any ideas?
> > 
> > TIA
> > 
> > (is meat head one word or two?)
> > 
0
Reply Utf 1/18/2008 6:51:01 PM

I don't know if this technique would work for you, but I had a similar 
situation with a form where I needed 7 list boxes.  It took 2 to 5 minutes to 
open.  So, took the row source off each list box, set its height to 0", and 
put a command button just above each list box.  In the click event of the 
list box, I assigned the row source to the list box, set the height to what 
is was in design view, and set the focus to it.
It loaded very fast and even the largest rowsource used a filtered query 
that looked up values in a table with about 20,000 rows.
-- 
Dave Hargis, Microsoft Access MVP


"Beetle" wrote:

> Thanks Dave. I hadn't thought of that, but I'll try that when I get a chance. 
> It's not a big deal, but right now my form loads a little bit slower than I'd 
> like and I think it's because I have 4 list boxes, so I'm just looking at 
> alternatives.
> 
> As usual, there is nothing "meatheadish" about your advice.
> 
> meatheadish - that's a word right?
> Note to self: find a dikshunairee ;-)
> 
> -- 
> _________
> 
> Sean Bailey
> 
> 
> "Klatuu" wrote:
> 
> > I have not tried this, but I had an idea that maybe using a Union query as 
> > the row source of the list box.  Union another query that would Sum the 
> > values for your.
> > Just a spurious thought.
> > -- 
> > Dave Hargis, Microsoft Access MVP
> > 
> > 
> > "Beetle" wrote:
> > 
> > > In one of my db's (A2003) I have a listbox that displays CurrentDate,
> > > CompanyName, CountOfInvoices, SumOfInvoices. I'm wondering If there is
> > > a way to display a sum of all the items in, for example, Column(2) and
> > > (3) of the list box to get a grand total.
> > > 
> > >  Right now I'm using a separate list box to display the values I want,
> > > which works fine, so mostly I'm just curious. I couldn't figure out a
> > > way to do it, but maybe I'm just being a meat head and overlooking
> > > something.
> > > 
> > > Any ideas?
> > > 
> > > TIA
> > > 
> > > (is meat head one word or two?)
> > > 
0
Reply Utf 1/18/2008 6:59:00 PM

Now that's a really good idea! I like that solution.

Again, thanks for your advice Dave. I appreciate it.
-- 
_________

Sean Bailey


"Klatuu" wrote:

> I don't know if this technique would work for you, but I had a similar 
> situation with a form where I needed 7 list boxes.  It took 2 to 5 minutes to 
> open.  So, took the row source off each list box, set its height to 0", and 
> put a command button just above each list box.  In the click event of the 
> list box, I assigned the row source to the list box, set the height to what 
> is was in design view, and set the focus to it.
> It loaded very fast and even the largest rowsource used a filtered query 
> that looked up values in a table with about 20,000 rows.
> -- 
> Dave Hargis, Microsoft Access MVP
> 
> 
> "Beetle" wrote:
> 
> > Thanks Dave. I hadn't thought of that, but I'll try that when I get a chance. 
> > It's not a big deal, but right now my form loads a little bit slower than I'd 
> > like and I think it's because I have 4 list boxes, so I'm just looking at 
> > alternatives.
> > 
> > As usual, there is nothing "meatheadish" about your advice.
> > 
> > meatheadish - that's a word right?
> > Note to self: find a dikshunairee ;-)
> > 
> > -- 
> > _________
> > 
> > Sean Bailey
> > 
> > 
> > "Klatuu" wrote:
> > 
> > > I have not tried this, but I had an idea that maybe using a Union query as 
> > > the row source of the list box.  Union another query that would Sum the 
> > > values for your.
> > > Just a spurious thought.
> > > -- 
> > > Dave Hargis, Microsoft Access MVP
> > > 
> > > 
> > > "Beetle" wrote:
> > > 
> > > > In one of my db's (A2003) I have a listbox that displays CurrentDate,
> > > > CompanyName, CountOfInvoices, SumOfInvoices. I'm wondering If there is
> > > > a way to display a sum of all the items in, for example, Column(2) and
> > > > (3) of the list box to get a grand total.
> > > > 
> > > >  Right now I'm using a separate list box to display the values I want,
> > > > which works fine, so mostly I'm just curious. I couldn't figure out a
> > > > way to do it, but maybe I'm just being a meat head and overlooking
> > > > something.
> > > > 
> > > > Any ideas?
> > > > 
> > > > TIA
> > > > 
> > > > (is meat head one word or two?)
> > > > 
0
Reply Utf 1/18/2008 7:08:02 PM

4 Replies
464 Views

(page loaded in 0.747 seconds)


Reply: