Importing Data Error Checking

  • Thread starter Thread starter Justin
  • Start date Start date
J

Justin

I have two vendors for the same product. I'm importing data for their
supplied files. The two are different formats and field layouts (cvs & xls).
I'm able to import the data with out a problem using TransferText and
TransferSpreadsheet.

I would like to provide some error checking incase an operator selects the
wrong data type. Currently the system just stops.

If MsgBox("Is this Data?", vbQuestion + vbYesNo, "Data Selection") = vbYes
Then
DoCmd.TransferText acImportDelim, , "vwOne", _
fnVar, True
Else
DoCmd.TransferSpreadsheet _
TransferType:=acImport, _
TableName:="vwTwo", _
FileName:=fnVar, _
HasFieldNames:=True
End If

Any suggestions would be appreciated.
 
Also, blanks rows are sometimes imported with the data. I'm importing into a
key field so this causes the error message. Is there a way to suppress the
import or the message?
 
Back
Top