Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Saved Import - How to Run From VBA

1,405 views
Skip to first unread message

Gilgamesh

unread,
Apr 18, 2012, 1:05:57 PM4/18/12
to
Hi All,
I have a saved import that is called "Import-ACES2_Applicants" when I
look at it from the External Data -> Saved Imports Menu.

I'd like to run it from VBA so that I can have it called by clicking a
menu button, or I may call it from the db open event. My problem is
that I'm not sure how to call it from VBA.

I searched this discussion group but the only relevant post did not
show VB code but discussed how to find the name of the saved import.
It said look in mSysObjects, but I cannot find any reference to my
saved import in MSysObjects.

Any help appreciated,

Michael

Patrick Finucane

unread,
Apr 18, 2012, 2:47:16 PM4/18/12
to
You don't mention what you are importing. I'll assume a textfile. So
I'll use the command to import text. Here's an example
docmd.TransferText
acImportFixed,"SpecName","TableName","FileName",True

Albert D. Kallal

unread,
Apr 18, 2012, 3:34:46 PM4/18/12
to
"Gilgamesh" wrote in message
news:a5b21c41-ba9f-4e45...@to5g2000pbc.googlegroups.com...

>Hi All,
>I have a saved import that is called "Import-ACES2_Applicants" when I
>look at it from the External Data -> Saved Imports Menu.

>I'd like to run it from VBA so that I can have it called by clicking a
>menu button,

This is the new import/export feature - arrived in 2007 I think.

The command is this:

docmd.RunSavedImportExport "name of save import export"

so:

docmd.RunSavedImportExport "Import-ACES2_Applicants"

--
Albert D. Kallal
Edmonton, Alberta Canada
PleaseNoS...@msn.com

Gilgamesh

unread,
Apr 18, 2012, 4:06:55 PM4/18/12
to
On Apr 18, 12:34 pm, "Albert D. Kallal" <PleaseNOSpamkal...@msn.com>
wrote:
> PleaseNoSpam_kal...@msn.com

Thanks Albert and Patrick.
I am indeed importing a text file into a table It's Access 2010.
I'll try both your methods and see which works best for me.
Mike
0 new messages