Hi there,
I have been trying to solve a "problem" and found the following answer on an other Forum to exactly my question / problem.
But I would really need an example of such a vba code to open a recordset example code... Does anyone have something similar handy? Ideal would also be with the sendmail comand with the Excel export of the concerned records too
Answer that I found:
"You need a query based on the table which will give you all the product numbers. Opening the table or a form with a macro won't work for this.
If I understand correctly, you need to export the details for each product and to have each product's details export separately.
You can create the query that will give the needed info about the product ready to export (first query).
Create another query that lists all the product numbers that you want to use, one at a time, in the first query above (this will be the second query).
You don't mention if you are comfortable with writing vba and why you specifically need a macro. If you need help with the vba, post back.
You will need some vba code to open a recordset on the second query, grab the product number and feed it into the first query, then do your export.
With the recordset open on the second query, move to the next product number and repeat the process until you have exported info for each product.
I have been trying to solve a "problem" and found the following answer on an other Forum to exactly my question / problem.
But I would really need an example of such a vba code to open a recordset example code... Does anyone have something similar handy? Ideal would also be with the sendmail comand with the Excel export of the concerned records too

Answer that I found:
"You need a query based on the table which will give you all the product numbers. Opening the table or a form with a macro won't work for this.
If I understand correctly, you need to export the details for each product and to have each product's details export separately.
You can create the query that will give the needed info about the product ready to export (first query).
Create another query that lists all the product numbers that you want to use, one at a time, in the first query above (this will be the second query).
You don't mention if you are comfortable with writing vba and why you specifically need a macro. If you need help with the vba, post back.
You will need some vba code to open a recordset on the second query, grab the product number and feed it into the first query, then do your export.
With the recordset open on the second query, move to the next product number and repeat the process until you have exported info for each product.