Song,
I am not sure whether there is a more sophisticated way to do this. But I
have handled this problem by using an OpenQuery action in the macro, to run
a Make-Table query that creates such a table, in your case
sapbud_ImportErrors. If the table does not already exist, it makes one. If
the table does already exist, it overwrites the existing one. Either way,
you then avoid the error that you would otherwise get with the DeleteObject
action if there is no such table.
--
Steve Schapel, Microsoft Access MVP
"Song Su" <(E-Mail Removed)> wrote in message
news:A8EAAC43-A994-48C4-AFDD-(E-Mail Removed)...
> When I import using macro, error tables created for each run. They are
>
> sapbud_ImportErrors
> sapbud_ImportErrors1 etc
>
> How to use IF statement in macro? If these error tables exist, delete.
>
> Thanks.
>
> Song
|