Solved

Need to display msg if table exists in Access2003 dB

Posted on 2012-04-09
3
280 Views
Last Modified: 2012-04-09
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
Comment
Question by:Muskie12
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 37823508
If DCOUNT("*", "mSysObjects", "[Name] Like '*_ImportErrors'") > 0 then
   msgbox "There were import errors"
endif
0
 

Author Closing Comment

by:Muskie12
ID: 37823542
Thanks for quick solution!
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 37823573
Glad to help.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question