Peter Bellamy
Registered User.
- Local time
- Today, 22:33
- Joined
- Dec 3, 2005
- Messages
- 295
I am trying to tidy up some report code and add some new features, can anyone point me in the right direction.
What I currently have is: 8 Reports based on 8 queries all listed in a macro.
The user clicks the button the macor runs and 8 reports are previewed.
I want to 'convert' this to VBA using SQL so I can introduce two additional pieces of variable information not in the tables, a discount % and a Customer name for the report heading, both will be used in all 8 reports.
The reason for thinking SQL is the way to go is because the contents of the reports are the same and they are based on similar queries, only the product name and the consequential selection varies.
They are price lists of parts for a product, and obtain the data from two tables, tblParts and tblCarriage, tblParts having numerous fields listing "where used" which is used to select the parts for that product price list.
I have so far a working dialog box that provides the user input of Discount and Customer.
I have also now a workiing SQL statement with a variable in it that can be the "product name".
What I want guidance on is how to use the query to generate the reports and, a slick way to loop around the SQL substituting the "product name"
Sorry this is such a wordy post but I was trying make it as clear as possible !!!
Cheers
Peter
What I currently have is: 8 Reports based on 8 queries all listed in a macro.
The user clicks the button the macor runs and 8 reports are previewed.
I want to 'convert' this to VBA using SQL so I can introduce two additional pieces of variable information not in the tables, a discount % and a Customer name for the report heading, both will be used in all 8 reports.
The reason for thinking SQL is the way to go is because the contents of the reports are the same and they are based on similar queries, only the product name and the consequential selection varies.
They are price lists of parts for a product, and obtain the data from two tables, tblParts and tblCarriage, tblParts having numerous fields listing "where used" which is used to select the parts for that product price list.
I have so far a working dialog box that provides the user input of Discount and Customer.
I have also now a workiing SQL statement with a variable in it that can be the "product name".
What I want guidance on is how to use the query to generate the reports and, a slick way to loop around the SQL substituting the "product name"
Sorry this is such a wordy post but I was trying make it as clear as possible !!!
Cheers
Peter