Solved

Easy way to check if a file exists in access vb

Posted on 2011-02-23
2
392 Views
Last Modified: 2013-11-28
Need a simple way to check if a file exists in access so if the file does not exist it bypasses the query. The code I attached works if you step through the code using F8, But if you run the code it blows through the err checks and trys to run the query. Any suggestions would be great.
Dir ("SurveyTbl")
If Err.Number = 3078 Then GoTo dorest



    Call ClearTbl("E2distinctSurveyDistrict")
    CurrentDb.Execute "E2SurveyTblQryAppend"
  


dorest:

Open in new window

0
Comment
Question by:needhelpfast569
2 Comments
 

Accepted Solution

by:
needhelpfast569 earned 0 total points
ID: 34962395
Found the answer.
0
 
LVL 77

Expert Comment

by:peter57r
ID: 34962422
Dir () doesn't return an error if the file is not found.
It just returns ""
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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

860 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