•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 456,544 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,329 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 801 | Replies: 6
![]() |
Create a table called Inventory that contains all of your products with a field called "ProdId". Create a table called DesiredProds that contains the product id's you want to select.
Use the following SQL statement to get what you want.
SELECT * FROM Inventory INNER JOIN DesiredProds ON Inventory.ProdId = DesiredProds.ProdId
Make sure that there are no duplicate ProdId's in either table or you will get duplicate records in your output.
Hoppy
Use the following SQL statement to get what you want.
SELECT * FROM Inventory INNER JOIN DesiredProds ON Inventory.ProdId = DesiredProds.ProdId
Make sure that there are no duplicate ProdId's in either table or you will get duplicate records in your output.
Hoppy
•
•
Join Date: Sep 2007
Posts: 65
Reputation:
Rep Power: 2
Solved Threads: 0
ok i have managed to do that by using VB coding to create a mulptiple value parameter query! Now I need to display and the name of the customer buying the products but access does not let me use 2 queries on one report because the tables are not connected it says !!!
Customers Table:
Customer Id:
Name
Surname:
Telephone:
Products table:
Product Code:
Description
Price:
Customers Table:
Customer Id:
Name
Surname:
Telephone:
Products table:
Product Code:
Description
Price:
Thinking about your original question, it really seem like what you want to do is to have two tables that represent your invoices. One table (InvoiceHeader) that contains one row for each Invoice (each row containing the Id of the Customer to whom you sold products) and a (LineItem) table containing one row for each item you sold on each invoice. The LineItem table would have the InvoiceNumber, the ProductId, the Quantity and the Price and maybe some other stuff.
What it seems like you want to do is to search the LineItem table for the desired products and for each one found, find the CustomerId in the InvoiceHeader table using the InvoiceNumber in the LineItem table. From there, find the CustomerName in the CustomerTable using the CustomerId in the InvoiceHeader table.
Do I understand what you are looking for or am I off track?
Hoppy
What it seems like you want to do is to search the LineItem table for the desired products and for each one found, find the CustomerId in the InvoiceHeader table using the InvoiceNumber in the LineItem table. From there, find the CustomerName in the CustomerTable using the CustomerId in the InvoiceHeader table.
Do I understand what you are looking for or am I off track?
Hoppy
Last edited by hopalongcassidy : Oct 17th, 2007 at 11:47 pm.
If you want to be able to type in this information, you will need to create a form. The form should contain information to orient the person entering the information as well as fields into which the information can be entered. Also, you will need to have a "Submit" and a "Cancel" button.
Put the logic to process the input in the Submit_OnClick() method. If you are using MS Office - Professional Edition, you can generate the this method from the properties window by clicking on the "On Click" event, then click on the "...", then click on "Code Builder", then click "OK".
Put the logic to process the input in the Submit_OnClick() method. If you are using MS Office - Professional Edition, you can generate the this method from the properties window by clicking on the "On Click" event, then click on the "...", then click on "Code Builder", then click "OK".
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Is it possible to display report in Visual Basic which is created in Microsoft Access (Visual Basic 4 / 5 / 6)
- Reference to Row in Access Report (Visual Basic 4 / 5 / 6)
- Rofl @ rep (Geeks' Lounge)
- Access Linking a Form to a report (MS Access and FileMaker Pro)
- problem in exporting crystal report (ASP.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: creating table with desired field
- Next Thread: Help with Picture Box


Linear Mode