I want to be able to export a query to excel, but I want to export each record to it's own workbook.
the data would like like this:
Site | Contact | Phone number
-------------------------------------------
Here | Joe B | xxxxx-xxxxxxx
This what I have so far. As you can see I am missing the most important part.
------------------------------
Dim rst As DAO.Recordset
Dim qdf As QueryDef
Dim prm As DAO.Parameter
Dim objword As excel.Workbook
Set objword = New excel.Workbook
Set qdf = CodeDb.QueryDefs("site_contact")
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next prm
Set rst = qdf.OpenRecordset()
Do Until rst.EOF
rst.MoveNext
Loop
the data would like like this:
Site | Contact | Phone number
-------------------------------------------
Here | Joe B | xxxxx-xxxxxxx
This what I have so far. As you can see I am missing the most important part.
------------------------------
Dim rst As DAO.Recordset
Dim qdf As QueryDef
Dim prm As DAO.Parameter
Dim objword As excel.Workbook
Set objword = New excel.Workbook
Set qdf = CodeDb.QueryDefs("site_contact")
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next prm
Set rst = qdf.OpenRecordset()
Do Until rst.EOF
rst.MoveNext
Loop