D
dbguy11
I have simple import routine that pulls any txt file from a selected folder
and uses an import spec I created puts the txt file into a table I created in
Access. What is the best way to filter out bad records during the import.
Right now I use a delete query and just delete any record with a null value
in the Unit Price field. There is also a Type Code field that is always 207
if it is a good record and I could filter it that way. Below is the import
routine I use, if you have any suggestions on how to change to filter the bad
records I would appreciate it very much. Thanks in advance for any assistance
you can provide me.
Function btnImportAll()
Dim strfile As String
ChDir ("c:\PX06")
strfile = Dir("*.*")
Do While Len(strfile) > 0
DoCmd.TransferText acImportDelim, "PX06", _
"PX06", "c:\PX06\" & strfile, True
Kill "c:\PX06\" & strfile
strfile = Dir
Loop
End Function
and uses an import spec I created puts the txt file into a table I created in
Access. What is the best way to filter out bad records during the import.
Right now I use a delete query and just delete any record with a null value
in the Unit Price field. There is also a Type Code field that is always 207
if it is a good record and I could filter it that way. Below is the import
routine I use, if you have any suggestions on how to change to filter the bad
records I would appreciate it very much. Thanks in advance for any assistance
you can provide me.
Function btnImportAll()
Dim strfile As String
ChDir ("c:\PX06")
strfile = Dir("*.*")
Do While Len(strfile) > 0
DoCmd.TransferText acImportDelim, "PX06", _
"PX06", "c:\PX06\" & strfile, True
Kill "c:\PX06\" & strfile
strfile = Dir
Loop
End Function