list box combining

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a list box that shows all the records off a query on the same form. I
have set it up so that you can click on a reference in the list box and it
will go straight to that record. However, I have amounts tied to each record
and I want the list box to combine all records of the same name.

In other words If I have a customer "Bill," and he has a payment of 200.00
on one record and payment of 150.00, I want the lsit box to show 350.00. The
records are pulling the amounts off a seperate form and query, but all
customers on this form remain the same. So I end up with two line items on
the list box that both lead to the same customer (same record) when clicked.

How can I get the list box to combine all records with the same customer name?
 
Hi,
You could try using a query similar to this to populate your listbox.

Select CustId, CustName, Sum(Payments) From someTable
Group By CustId, CustName

Now, you probably have to join two tables to do this and those aren't your field names of course...
but you were pretty scarce on the details of your data.
 
Back
Top