controling the spread of fields in the excel

  • Thread starter Thread starter thread
  • Start date Start date
T

thread

Hi all,
I'm trying to find a way to export the data in the form into excel.
is there a way to decide on the fields and culomns that are been
exported to the excel file?
 
is there a way to place SQL sentence inside of an ADO object and that
way it will be much more dynamic for me to do any changes

Jeff Boyce ëúá:
 
I'm afraid I don't have any experience in that area.

Good luck!

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/

is there a way to place SQL sentence inside of an ADO object and that
way it will be much more dynamic for me to do any changes

Jeff Boyce ëúá:
 
I'm not sure, but your VBA code can assign an SQL statement to a query
on the fly, e.g. (code snippet)

Const QToExport = "qryExportQuery"
Dim SQL As String

SQL = "SELECT "
'append list of fields to SQL
...
SQL = SQL & " FROM MyTable "
SQL = SQL & " WHERE ...
...

'Assign new SQL statement to query
CurrentDB.QueryDefs(QToExport).SQL = SQL

DoCmd.TransferSpreadsheet acExport, , qryExportQuery
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top