Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7590753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:29:00+00:00 2026-05-30T20:29:00+00:00

Part of some vba code I’m writing calls a saved import using: DoCmd.RunSavedImportExport import_name

  • 0

Part of some vba code I’m writing calls a saved import using:

DoCmd.RunSavedImportExport "import_name"

This is working quite well for me, except when the saved import does not exist. In that case it fails silently.

Is there a way to check whether the import definition exists so that I can raise an error or take other action if it doesn’t?

I’m using Access 2010 but it needs to work in 2003 as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:29:01+00:00Added an answer on May 30, 2026 at 8:29 pm

    Provide and error handler to resolve this issue (Access 2007 and higher):

    Sub Importer()
    On Error GoTo ErrImport
    
    DoCmd.RunSavedImportExport "import_name"
    
    ExitImporter:
      Exit Sub
    
    ErrImport:
      MsgBox Error 'Err = 31602 for missing import specification
      Resume ExitImporter
    
    End Sub
    

    A more general solution uses the TransferText command as follows:

    Sub Importer()
        On Error GoTo ErrImport
    
    DoCmd.TransferText acImportDelim, "Import_file Import Specification", "import_file", "import_file.txt", False
    
    ExitImporter:
      Exit Sub
    
    ErrImport:
        MsgBox "Error Number = " & Err & ", Message=" & Error ' Error 3011 indicates import_file.txt not found
        Resume ExitImporter
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In some part of my code I need something like this: $product_type = $product->type;
I am using XSL transform on XML. Some part of transform are dependent on
I'm working with an OpenXML document, processing the main document part with some XSLT.
In some part of my code I am passed a collection of objects of
Some part of my source code are nested inside try statements in order to
below is some part of code in my download gateway if (!isset($_GET['f']) || empty($_GET['f']))
I'm automating ie from within Excel VBA like this, in part Set ie =
In some part of my python program , I need to do this -
I need to find links in a part of some html code and replace
I have the following vba code is part of a larger script. The issue

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.