Trying to crate a new table: [PickupDonTbl] in an existing non-relational Db by extracting all records from table: [Donation_Data] where the Pickup Date = current date.
CREATE TABLE CurrentDb.PickupDonTbl AS SELECT * from Donation_Data WHERE [Pickup Date] = Date()
When I type in code I get CurrentDb "highlighted" with Compile error: Expected:end of error.
I then want to export this table to EXCEL using:
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "PickupDonTbl", "C:\Users\dads\BlindCtr\Donation Data.xlsx", True
(I have tested this part and it works)
All this code is initiated from a form in this Db with one command button "On Click"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "YourSavedSelectQueryName", ...instead of creating the temporary table and usingDoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "PickupDonTbl", .... - Gord Thompson