How to tell if import was successful

sumdumgai

Registered User.
Local time
Today, 18:16
Joined
Jul 19, 2007
Messages
453
I am starting Access and then an Access macro from within an Excel workbook using VBA. The Access macro runs a function that executes a number of sequential Access 'Saved Imports'. After the macro finishes, it returns control back to Excel via Switch_Window ("Excel").

Is there a way that I can absolutely be sure that all of the 'Saved Import' routines successfully imported all data withput any errors and pass that information back to Excel?

Thanks.
 
My choice would be to use Excel Automation in vba, wrap them in a function that performs the task, then checks for the data, and have that function return a true false.
 
You lost me. The 'Saved Imports' are already called from within a function that is executed by a Run Macro. HOw does the function return a true/false?
 
Build a custom function that runs the function, then checks the destination object to verifify it has new data.
Or, just run the built in macro, then write a custom automation function to verify the destination received the new data.
 
I'm already doing (i.e., checking starting and ending record counts) that but there are instances, for example, where some field doesn't get imported because of a format issue. In that case, the record count would appear to be good. Also, if any of the Saved Imports have an issue, I want to cancel the entire import. I guess what I'm looking for is some status that Access might give back that says either the import finished successfully or it had some problem.

Thanks.
 
You can always do a Dlookup on a table with specifed parameters. If it comes back null then your import failed. If it comes back true, then your import would be successful.
 
Thanks for making it clear. It is the data type conversion that is under question.
Another example might be to query the selected fields to validate IsNumeric, IsDate and some of the others. See if they come back true or false.
 
Thanks to all for your help. I'm going to check for new tables that were created that contained '_ImportErrors' in their names. Also will check starting and ending record counts.
 

Users who are viewing this thread

Back
Top Bottom