Try this -
Sub Export2xl()
Dim xl As Excel.Application
Dim ws As Excel.WorkSheet
Dim wb As Excel.Workbook
Dim tbl as ADODB.Recordset
Dim x As Long
Set tbl = New ADODB.Recordset
Set xl = New Excel.Application
Set wb = xl.workbooks.Add
Set ws = wb.sheets("Sheet1")
'First row contains Field...
A good code which should serve your purpose is given in "Access Data Analysis cook book" by Ken Bluttman & Wayne S Freeze(O'Reilly) on page 106. One more idea is to build a SQL string to be used as WhereCondition of a form's controlsource [see more in John L Viescas & Jeff Conrad's "Access 2007...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.