Solved

Need to display msg if table exists in Access2003 dB

Posted on 2012-04-09
3
284 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 48

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 48

Expert Comment

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

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

690 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