Access 2003 - Macro

Microsoft Office access 2003
January 31, 2011 at 11:08:31
Specs: Windows XP
I have written a Macro to automate a number of processes. The most important of which is to copy and paste/append data from a query, into a table that I have designed specifically for housing this set of queries data. My macro runs fine just as long as there are records to copy from the queries (a total of 4 populate the weekly table that exports into excel - the way my boss wants it - Don't Ask!) Anyway, IF any one of the queries is empty that week, the macro will error out right there because there is not data to select and copy. How would I handle this, with error handling, IF, then skip or go to next command in macro, what!? Thanks for all your help! Nicole

See More: Access 2003 - Macro

Report •

May 27, 2011 at 02:48:10
well it depends on how the macro is written, im assuming you have a loop that goes through each record and tries to copy paste until there are no more records?

If so, what you could do is, say something like, if record is empty do nothing and move next, else if record is not empty copy paste. This will force the code to continue running if it encounters an emprty record.

It looks like what you are doing is, tell the code to read data regardless of if it is emprt or not and paste. This obviously will error out.

So handle it by doing the above. A snipet of the code will ne helpful, post it and let us see what we can do.

Report •
Related Solutions

Ask Question