?
Solved

Easy way to check if a file exists in access vb

Posted on 2011-02-23
2
Medium Priority
?
395 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
[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 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

762 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