I have the following code which adds part of the imported filename (filetoimport010420071530.txt) as (01042007) to a field
If the field is set to date it does not import anything.
If I dim FinalName as Date it imports as 11/30/4752
This is all very new to me and I am lost!
How can I import the field as a date?
Thanks in advance,
--gd
If the field is set to text it imports fine, but is not a date.Public Function all()
Dim InputDir, ImportFile As String, tblName As String, FinalName As String
Dim InputMsg As String
InputDir = "C:\Imports\"
ImportFile = Dir(InputDir & "\*.txt")
FinalName = (Mid(ImportFile, 13, 8))
DoCmd.SetWarnings False
Do While Len(ImportFile) > 0
DoCmd.TransferText acImportDelimited, "Import_Spec", "Import", InputDir & ImportFile, True
DoCmd.RunSQL "UPDATE Import SET File_Date = '" & FinalName & "'" & " where File_Date is null"
ImportFile = Dir
Loop
End Function
If the field is set to date it does not import anything.
If I dim FinalName as Date it imports as 11/30/4752
This is all very new to me and I am lost!
How can I import the field as a date?
Thanks in advance,
--gd