Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VBA code using SavedImportExport procedure creates a table in the wrong database

Posted on 2010-09-02
4
Medium Priority
?
652 Views
Last Modified: 2013-11-27
Background: Every day we must refresh/update or overwrite Access tables with new data incoming on Excel spreadsheets.  For the most part, I'm using the Saved import/Export procedures built into Access and executing them with VBA code.  I don't know if this is the best way to bring in data from Excel but it's all I know.

Question: When I run a saved import procedure from an Access front end, a table is created in the front end instead of the backend.  Why doesn't the table refresh in the back-end instead?   Would someone pleasel ook at my code (attached).
DTR-import-code.txt
0
Comment
Question by:thutchinson
[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
  • 2
4 Comments
 
LVL 1

Expert Comment

by:momo4kids
ID: 33589133
When creating a SavedImport using the import wizard, the data is imported into the current database, even if that database is linked to a backend database.  

Create the import in the backend and use a macro to run the import code.  You can then add the macro to your desktop and run it from a shortcut.
0
 

Author Comment

by:thutchinson
ID: 33589789
That's what I figured. However, it is not practical to run a bunch of macros from the desktop.  I have several network users that need to execute from the frontend application.
How do I execute a macro in (from) the front end to run a SavedImport that will update tables in the backend?
0
 
LVL 1

Accepted Solution

by:
momo4kids earned 2000 total points
ID: 33590611
You can append the data to the existing table.  Create a query to clear out the existing data, then call the saved import and add the data to that table.
0
 

Author Comment

by:thutchinson
ID: 33590811
Thanks for your help.  I really appreciate it.
 
0

Featured Post

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

715 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