J
JumboShrimps
Trying to get a list of files not able to be
appended into my tblBdata. These linked .csv
files come from the field and while they <should>
be in the specific format, they are not always.
If there is something wrong with the file, error msg
at the DOCMD.runSQL statement is something like
"INSERT Statement contains the following...."
This is ok, but I would
A) Have the code continue (On error resume next)
to the next tdf,
and just not import that paticular file.
B) capture the name of the offending file from
StrTblName and save it(append StrTblName to
a "tblBadFile" table so I know which files
did not get imported.
Dim db As Database, tdf As TableDef
Set db = CurrentDb()
For Each tdf In db.TableDefs
StrTblName = tdf.Name
tblAtt = tdf.Attributes
strSQL = "INSERT INTO tblBData SELECT " & [StrTblName]
& ".* FROM " & [StrTblName] & ";"
DoCmd.RunSQL (strSQL)
Next
appended into my tblBdata. These linked .csv
files come from the field and while they <should>
be in the specific format, they are not always.
If there is something wrong with the file, error msg
at the DOCMD.runSQL statement is something like
"INSERT Statement contains the following...."
This is ok, but I would
A) Have the code continue (On error resume next)
to the next tdf,
and just not import that paticular file.
B) capture the name of the offending file from
StrTblName and save it(append StrTblName to
a "tblBadFile" table so I know which files
did not get imported.
Dim db As Database, tdf As TableDef
Set db = CurrentDb()
For Each tdf In db.TableDefs
StrTblName = tdf.Name
tblAtt = tdf.Attributes
strSQL = "INSERT INTO tblBData SELECT " & [StrTblName]
& ".* FROM " & [StrTblName] & ";"
DoCmd.RunSQL (strSQL)
Next