472,803 Members | 971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,803 software developers and data experts.

Executing Import Wizard via code

Hi all.

I'm trying to enhance the functionality of an MS Access application.

I want to give the user the capability to import a MS Access or MS
Excel table into the application *without* having to execute the Import
Wizard herself.

Q1:
So i'm basically looking for the VBA statement that will invoke the
Import Wizard (the equivalent of right-clicking in Tables view and
choosing: Import).

Q2:
Is there a way to capture the name of the table that's being imported?
I will need to append it to another one once the user has imported it.

If not, i was thinking to simply capture all the table names before the
user starts the Import Wizard and after he's done so, so the difference
would give me the name of the newly imported table.

Many thanks for your help,
Alex

Sep 28 '06 #1
2 4698
alex.hatzisavas wrote:
Q1:
So i'm basically looking for the VBA statement that will invoke the
Import Wizard (the equivalent of right-clicking in Tables view and
choosing: Import).
RunCommand acCmdImport
Q2:
Is there a way to capture the name of the table that's being imported?
No. Not with the wizard.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200609/1

Sep 28 '06 #2
Rolling your own would not be difficult and gives you better control.

Use the Windows open dialog to locate the file
Use ADOX to get the list of tables to display in a listbox
When the user selects the table
Get them to enter the local name (you know all the existing table &
query names so you can disallow any clashes)
Import the table

Should take about a day to do I would have thought.

You can then either use this in the db or create a library or wizard to make
it a bit more polished and re-usable.
--

Terry Kreft
"alex.hatzisavas" <al*************@gmail.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
Hi all.

I'm trying to enhance the functionality of an MS Access application.

I want to give the user the capability to import a MS Access or MS
Excel table into the application *without* having to execute the Import
Wizard herself.

Q1:
So i'm basically looking for the VBA statement that will invoke the
Import Wizard (the equivalent of right-clicking in Tables view and
choosing: Import).

Q2:
Is there a way to capture the name of the table that's being imported?
I will need to append it to another one once the user has imported it.

If not, i was thinking to simply capture all the table names before the
user starts the Import Wizard and after he's done so, so the difference
would give me the name of the newly imported table.

Many thanks for your help,
Alex

Oct 3 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bob | last post by:
Hi was wondering if any knows where I can find code examples that recreates the data import wizard in Access (or something similar)... this wizard lets the user select the data separator, select...
2
by: David Berry | last post by:
Hi All. I'm looking for any help or sample code that can show me how to make a file import wizard in ASP.NET (VB preferred) like the one that MS Access uses. I'm working on a web site where the...
5
by: David Aylott | last post by:
Greetings When I use the import text wizard with a fixed width text file, I add a break at the correct column but it doesn't line up with the text. It seems that the display is shown in a...
3
by: deko | last post by:
I've been trying to use the Access Import Wizard to expedite importing data into my mdb. The nice thing about the wizard is that I can import from different file formats - txt, xls, even Outlook -...
0
by: Bob | last post by:
Hi all, I'm trying to use code to start the text/spreadsheet import wizard because my file will change all the time and so I can't define a spec for it - I want the user to define everything. ...
2
by: pendell | last post by:
I am working with a client running 2003 Access. Some time ago I built them an import spec for use with the Import Wizard. Several months later, I have been called back and asked to solve a...
2
by: krishna.000.k | last post by:
file1.py ---------- a = 20 from abc import * print "Should this be printed when 'a' is alone imported from this module" file2.py ---------- from file1 import a
5
geolemon
by: geolemon | last post by:
Import text wizard says: I'm banging my head on this one, here's why: I've been importing files using this process and data format, with success! I created a temporary table in Access to...
2
DAF LAD
by: DAF LAD | last post by:
Hi. I have been running an access Database in Office 2003 for a while now. When I upgraded to Office 2007 one of my macro buttons has stopped working. The Button looks up to VBA code to Import...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.