Hello!
I am designing an import module in my access database for text files
it looks like this
This works fine but one thing. That is that i need to get the text file's creation date from the file properties.
Is there any way to do this?
I am designing an import module in my access database for text files
it looks like this
Code:
Dim GammeltNavn As String
Dim NyttNavn As String
Dim MaskinNavn As String
Dim fsoFileSearch As FileSearch
Set fsoFileSearch = Application.FileSearch
With fsoFileSearch
'Dim NettVerkssøk As New ADODB.Recordset
' NettVerkssøk.Open "SELECT * from [tbl atfmaskiner]", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
' Do Until NettVerkssøk.EOF
.NewSearch
'.LookIn = "\\" & NettVerkssøk!Maskinnavn & "\ATF" & Right(NettVerkssøk!Maskinnavn, 1)
.LookIn = "C:\ATF4"
.FileType = msoFileTypeAllFiles
.SearchSubFolders = False
MaskinNavn = "Gemba Maskin 4"
Dim RSTFRA As New ADODB.Recordset
Dim RSTTIL As New ADODB.Recordset
Dim RSTTIL2 As New ADODB.Recordset
If .Execute(msoSortByLastModified) > 0 Then
'MsgBox .FoundFiles.Count & " fil(er) funnet"
For i = 1 To .FoundFiles.Count
MsgBox .PropertyTests
If Right(.FoundFiles(i), 2) = "F6" Then
GammeltNavn = .FoundFiles(i)
NyttNavn = Left(GammeltNavn, (Len(GammeltNavn) - 3)) & ".txt"
Name GammeltNavn As NyttNavn
DoCmd.TransferText acImportFixed, "maskinpåfylling", "tbl maskinpåfylling", NyttNavn, False, ""
Kill NyttNavn
This works fine but one thing. That is that i need to get the text file's creation date from the file properties.
Is there any way to do this?
Comment