Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate data from two tables to listview

Status
Not open for further replies.

Poloboy

Technical User
Aug 26, 2002
58
US
Hi Everyone,
I have two tables, Customer and Orders it has a relationship by AccountID. Each customer will have multiple orders. Everytime I added a new order to Orders database for a customer, the listview shows up another record of the same customer except order is different Why is that? Could it the Relationship with AccountID?. I have 2 listviews. One is for Customer info and the other will show all the orders from the individual customer when I click on that customer. What SELECT statement do I use? or is there a better way?
 
What SELECT statement do I use?

To do what exactly?

It sounds like the system is working correctly. Each time you create a new order it is appearing in the listbox as an additional order for that customer. From your description, it seems like that's exactly what should happen.

What were you expecting instead?
 
What happen was it duplicates the customer. Let say I have Customer1 created with one order enter then it show up under CUSTOMER and ORDERS listview fine. But if I add another order for Customer1 then Customer1 info got duplicated. So now i'm seeing 2 Customer1 under CUSTOMER listview. But when I look at the database only one record of Customer1 in CUSTOMER table and 2 records in ORDERS table. The database records was correct. The problem I have was to display the right number of records to listview. The display result should be:

CUSTOMER LISTVIEW: ORDERS LISTVIEW:
Customer1 order1
order2
but instead I get this:
CUSTOMER LISTVIEW: ORDERS LISTVIEW:
Customer1 order1
Customer1 order2

I hope i explain it. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top