aziz rasul
Active member
- Local time
- Today, 15:45
- Joined
- Jun 26, 2000
- Messages
- 1,935
I have two tables (let's call them Table1 & Table2) that I export to a particular part of the hard drive. Table1 is always populated, while Table2 can be populated or have no records.
Here's the problem.
When using DoCmd.TransferSpreadsheet for both tables, the export is successful when both tables are populated and overwrite the existing spreadsheets, if they exist, without any problems.
However if Table2 has no records AND the spreadsheet for this table already exists, an error occurs which effectively say's that the file already exists.
I can get around the problem by first counting the records in Table2 and only exporting if there is at least one record.
However I would like to know whether there is a different way of solving the problem.
Here's the problem.
When using DoCmd.TransferSpreadsheet for both tables, the export is successful when both tables are populated and overwrite the existing spreadsheets, if they exist, without any problems.
However if Table2 has no records AND the spreadsheet for this table already exists, an error occurs which effectively say's that the file already exists.
I can get around the problem by first counting the records in Table2 and only exporting if there is at least one record.
However I would like to know whether there is a different way of solving the problem.