I have this code which appropriately imports all files from excel in a folder with a certain wildcard name:
In the access table that the data is imported in to, there is a field called FILENAME. When importing the data I would like it to put which excel file name it is importing from into that access field.
Is that possible?
Thank you!
Code:
Private Sub Command4_Click()
Dim ImportDir As String, ImportFile As String
ImportDir = "G:\CCC\Payer Relations-Contracting\Payer Data Files\Connecticare\"
ImportFile = Dir(ImportDir & "CCI_CCMC_MULTI_ERDLYRPT_BU_FD01_PROD*")
Do While ImportFile <> ""
DoCmd.TransferSpreadsheet acImport, , "Import_CTCare_ER_Daily", ImportDir & ImportFile, True, "A:AB"
ImportFile = Dir
Loop
End Sub
In the access table that the data is imported in to, there is a field called FILENAME. When importing the data I would like it to put which excel file name it is importing from into that access field.
Is that possible?
Thank you!