Solved

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

Posted on 2010-09-02
4
640 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
  • 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 500 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now