Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 653
  • Last Modified:

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

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
thutchinson
Asked:
thutchinson
  • 2
  • 2
1 Solution
 
momo4kidsCommented:
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
 
thutchinsonAuthor Commented:
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
 
momo4kidsCommented:
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
 
thutchinsonAuthor Commented:
Thanks for your help.  I really appreciate it.
 
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now