Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 287
  • Last Modified:

Need to display msg if table exists in Access2003 dB

I have an access 2003 dB with code that imports data into several tables and executes Queries and stuff. SetWarnings is false and I need to keep it that way.

Once in a while, there will be a problem whereby some records fail to be imported into a particular table and I need to know when this has happened - but not until after all the VBA code has run since there will be occasions when these missing records are acceptable.

I'm looking for some VBA code I can place at the end of the Sub that will check for the  presence of any table in the dB that has a suffix of "_ImportErrors" and send me a msg if one or more tables have this suffix.
0
Muskie12
Asked:
Muskie12
  • 2
1 Solution
 
Dale FyeCommented:
If DCOUNT("*", "mSysObjects", "[Name] Like '*_ImportErrors'") > 0 then
   msgbox "There were import errors"
endif
0
 
Muskie12Author Commented:
Thanks for quick solution!
0
 
Dale FyeCommented:
Glad to help.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now