Ok, I am importing dynamic amounts of data into a table, i normalise it and run queries on it. I want the results from these queries exporting to seperate worksheets. So if there are 15 columns of data imported i want them to have queries run on them (minus the first 2 columns because they are static fields), then the results to be exported to individual spreadsheets. So far I have the following code:
Code:
[/code]
dim strsql as string
dim db as database
dim rs as recordset
set db = currentdb
strsql = "(I still need to have a worksheet when node outputs are 0)"
set rs = db.openrecordset(strsql)
while not rs.eof do
strsql = "insert into temptable" & rs![TestName] & "select * from tblImportTableTest where node = '" & rs![TestName] & "'"
docmd.transferspreadsheet acexport, acSpreadsheetTypeExcel2000, template.xls, temptable & your distinct node from above, -1
'delete temptable (not sure how)
rs.movenext
loop
[/code]
The information being imported is data from different locations (each one being called a node), and the names of each node and the amount of nodes will vary.
The table the data is imported into is called 'tblImportTableTest'.
The template of the file im exporting to is called 'template.xls'.
TestName is the field name in the table that each of the nodes are under.
So i need some help finishing this and making it work. Can anyone offer any support?
Thanks,
Marley.
Code:
[/code]
dim strsql as string
dim db as database
dim rs as recordset
set db = currentdb
strsql = "(I still need to have a worksheet when node outputs are 0)"
set rs = db.openrecordset(strsql)
while not rs.eof do
strsql = "insert into temptable" & rs![TestName] & "select * from tblImportTableTest where node = '" & rs![TestName] & "'"
docmd.transferspreadsheet acexport, acSpreadsheetTypeExcel2000, template.xls, temptable & your distinct node from above, -1
'delete temptable (not sure how)
rs.movenext
loop
[/code]
The information being imported is data from different locations (each one being called a node), and the names of each node and the amount of nodes will vary.
The table the data is imported into is called 'tblImportTableTest'.
The template of the file im exporting to is called 'template.xls'.
TestName is the field name in the table that each of the nodes are under.
So i need some help finishing this and making it work. Can anyone offer any support?
Thanks,
Marley.