0

hi to everyone,
Im creating an application which it can show all records of the two tables in single form. its like costumerTable and OrderList. how can i show a record of specific costumer from costumertable together with his product order details from OrderList table. Supposed I have costumerNo field from my costumertable and also i have costumerNo field in my Orderlist table. I also wants to show the order details in datagrid view supposed costumer bought 5 items. can anyone help me find solution. any help we'll be appreciated. thanks

6
Contributors
10
Replies
12
Views
9 Years
Discussion Span
Last Post by jireh
0

let's say you have variable costumernr with the costumer's nummer and variable amount
adodc1.recordsource = "Select * from tblorder where costumerno = " & costumernr
adodc1.refresh
amount = adodc1.recordcount 'gives you the amount of records with that costumer nummer

do while not adodc1.recordset.eof
'do whatever you want to do with the orders of that costumer nummer
loop

0

Join both the tables using SQL command and display the output on grid.

can you please show me your code in LEFT JOIN. I really do not know how is it. thanks

0

lets say from Customer Table I have CustCode, CustName, CustAdd, CustTel. from my OrderList I have CustCode, PONum, ItemName, QTY, Amt.

I want to get all the records that my customer bought. e.i. customer bought 5 items. the other day he bought 10 items. how can i use sql to join two tables to be able to show the record which my customer bought (the 10 items). what should i do. is there any changes to my table structure for this..kindly post your suggestion please...

0

lets say from Customer Table I have CustCode, CustName, CustAdd, CustTel. from my OrderList I have CustCode, PONum, ItemName, QTY, Amt.

I want to get all the records that my customer bought. e.i. customer bought 5 items. the other day he bought 10 items. how can i use sql to join two tables to be able to show the record which my customer bought (the 10 items). what should i do. is there any changes to my table structure for this..kindly post your suggestion please...

0

hi to everyone,
Im creating an application which it can show all records of the two tables in single form. its like costumerTable and OrderList. how can i show a record of specific costumer from costumertable together with his product order details from OrderList table. Supposed I have costumerNo field from my costumertable and also i have costumerNo field in my Orderlist table. I also wants to show the order details in datagrid view supposed costumer bought 5 items. can anyone help me find solution. any help we'll be appreciated. thanks

>>try to used Query...In mS access

0

this is the query:
"SELECT CustName, CustAdd, CustTel.,
PONum, ItemName, QTY, Amt.
FROM Customer
LEFT JOIN OrderList
USING (CustCode)
WHERE CustCode='*your input****' ";
Got it?
Hope it helps....

0

here's a sample:

str = "select [Book File].Author,[Book File].BookTitle,Return,Penalty,[Transaction File].StudentNumber from ([Transaction Table] left join [Book File] on [Transaction Table].AccessionNumber=[Book File].AccessionNumber left join [Student File] on [Transaction Table].StudentNumber=[Student File].StudentNumber where return=1 and penalty<>0 and BorrowDate>='" & Format(dtpDateFrom, vbShortDate) & "' and BorrowDate<='" & Format(dtpDateTo, vbShortDate) & "'"

This is a three joned table

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.