Hi Gurus
I have a code that copies a database using the common windows dialog box to a temporal import folder from which i transfer a table to my database using:
Function ImportPatients()
On Error GoTo ImportPatients_Err
DoCmd.TransferDatabase acImport, "Microsoft Access", "C:\x\Import\xx.mdb", acTable, "BLP_Data", "x_Imported", False
ImportPatients_Exit:
Exit Function
ImportPatients_Err:
'apam
MsgBox "Could Not Import Data", vbExclamation + vbOKOnly, "Unsuccessful Data Merge"
Resume ImportPatients_Exit
End Function
now if i did not select a valid database the code crushes when it reaches the point:
DoCmd.TransferDatabase acImport, "Microsoft Access", "C:\x\Import\xx.mdb", acTable, "BLP_Data", "x_Imported", False
-----which is expected------
I actually get the run error 3343------again expected because i did not copy a valid database....
Now my question:
Is there a way to trap this error...
By the way this code is running in a class module
Thanks
I have a code that copies a database using the common windows dialog box to a temporal import folder from which i transfer a table to my database using:
Function ImportPatients()
On Error GoTo ImportPatients_Err
DoCmd.TransferDatabase acImport, "Microsoft Access", "C:\x\Import\xx.mdb", acTable, "BLP_Data", "x_Imported", False
ImportPatients_Exit:
Exit Function
ImportPatients_Err:
'apam
MsgBox "Could Not Import Data", vbExclamation + vbOKOnly, "Unsuccessful Data Merge"
Resume ImportPatients_Exit
End Function
now if i did not select a valid database the code crushes when it reaches the point:
DoCmd.TransferDatabase acImport, "Microsoft Access", "C:\x\Import\xx.mdb", acTable, "BLP_Data", "x_Imported", False
-----which is expected------
I actually get the run error 3343------again expected because i did not copy a valid database....
Now my question:
Is there a way to trap this error...
By the way this code is running in a class module
Thanks