Minty
AWF VIP
- Local time
- Today, 02:27
- Joined
- Jul 26, 2013
- Messages
- 10,642
Okay - Lets go through those;
1. Think that's just a typo on my behalf.
2. Yes you will need to delete it after it's been used but before the next loop is processed. You'll need a
It might be worth changing the name of that to something more obtuse.
3. Now you have the query per broker, so let's create the spreadsheet.
You'll want each one to have a different name otherwise you'll just be overwriting the same one all the time.
Add a new couple of new Dims at the top of the code -
Set the sfilepath before the loop.
Then in your loop, before destroying the query we'll add in the filename and the transfer to spreadsheet ;
1. Think that's just a typo on my behalf.
2. Yes you will need to delete it after it's been used but before the next loop is processed. You'll need a
Code:
DoCmd.DeleteObject acQuery, "Query1"
3. Now you have the query per broker, so let's create the spreadsheet.
You'll want each one to have a different name otherwise you'll just be overwriting the same one all the time.
Add a new couple of new Dims at the top of the code -
Code:
Dim sFilePath as String
Dim sFileName as String
Set the sfilepath before the loop.
Code:
sfilepath = "c:\somepath\OnYourPC\"
Then in your loop, before destroying the query we'll add in the filename and the transfer to spreadsheet ;
Code:
sFileName = "OpenBrokerRep_" & iAcctNo & ".xls"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Query1", sFilePath & sFileName