I'm using the following code to import all the files in a specific directory. Some of the files have nothing in it 0 kb. How do I change the code to ignore those.
Function ImportDetail()
On Error GoTo Macro1_Err
Dim FileName As String
Dim FolderName As String
FolderName = "c:testinvoice Detail"
FileName = Dir(FolderName & "*.txt")
While FileName <> ""
DoCmd.TransferText acImportDelim, "DetailImport", "InvoiceDetail", FolderName & "" & FileName
FileName = Dir()
Wend
Macro1_Exit:
Exit Function
Macro1_Err:
MsgBox Error$
Resume Macro1_Exit
End Function
Thanks



