[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 350
  • Last Modified:

MS Access output to Excel

Hi

I currently use the following statement to output tables in Access to Excel:

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "AccessTablexx", outputFileName, True

I now have a new Access table but I only wish to output rows from the new table where a field value is > 0.  So if there are 100 rows in the table and only 6 rows have a value > 0 for a field I wish to output only those 6 rows to Excel.

As an alternative I could use VBA to remove rows in the Excel worksheet where the field value is 0 but I would prefer to filter the output from Access if that was possible.

Many thanks
Alison
0
alisonthom
Asked:
alisonthom
1 Solution
 
Rgonzo1971Commented:
HI,

Instead of a table you could create a query with your specifications and export it

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "yourAccessQuery", outputFileName, True

Regards
0
 
alisonthomAuthor Commented:
Yes, that would also be fine.  Thank you!
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Tackle projects and never again get stuck behind a technical roadblock.
Join Now