Godders199
Active Member
- Joined
- Mar 2, 2017
- Messages
- 313
- Office Version
- 2013
Hello, I am trying to write the code to import rows with a submission date of over 90 days ago into an existing table in access. I had VBA which will copy the whole worksheet, but now i just need to insert the rows into access which meet the about criteria.
My problem is i can't find any coding , to help with the filtering to meet criteria, before copying these rows. From what i can see it should be a docmd.applyfilter. The column heading with the date is Submissions date, and all dates are in the format DD/MM/YYYY.
Be grateful for any help.
Option Compare Database
Option Explicit
Public Sub importexcelspreadsheet()
Dim strexcelpath As String
strexcelpath = "S:\xxxx.xlsx"
docmd.applyfilter. [submissions date],date() 90
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "Allocation history", strexcelpath, True, ""
Thanks
My problem is i can't find any coding , to help with the filtering to meet criteria, before copying these rows. From what i can see it should be a docmd.applyfilter. The column heading with the date is Submissions date, and all dates are in the format DD/MM/YYYY.
Be grateful for any help.
Option Compare Database
Option Explicit
Public Sub importexcelspreadsheet()
Dim strexcelpath As String
strexcelpath = "S:\xxxx.xlsx"
docmd.applyfilter. [submissions date],date() 90
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "Allocation history", strexcelpath, True, ""
Thanks