Solved

MS-Access -- "Saved Import" procedure

Posted on 2014-11-25
9
106 Views
Last Modified: 2014-11-27
Experts:

We're currently conducting a survey (where users will return a standardized spreadsheet).

For importing purposes, I've created an import procedure ("External" tab | "Saved imports") that will facilitate importing the spreadsheet data into a database.

At this time, the saved procedure/operation points at the designated file path and -- once it finds the designated filename -- will successfully import the data.

Here's the challenge:   In order for the MS-Access procedure to work, the filename must be identical.   For example, the procedure refers to file path:  H:\...\...\...\Survey.xlsm

As you can imagine, this will require to import each spreadsheet one after the other (while also ensuring to rename the XLS from whatever filename a user may have chosen to "Survey.xlsm".

I tried to change the procedure's file path to: H:\...\...\...\*.xlsm
... unfortunately, that doesn't work.

Thus, how can I run an Access procedure and import dozens/hundreds of XLS spreadsheet at once without having to rename each XLS to "Survey.xlsm"?

Thanks,
EEH
0
Comment
Question by:ExpExchHelp
9 Comments
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40464559
You can loop through the directory for all xlsm files - see http://support.microsoft.com/kb/139724 for sample code.
0
 

Author Comment

by:ExpExchHelp
ID: 40464593
Phillip:

Thanks -- potentially the way forward.  However, the "External tab" (saved procedure does NOT list all of the steps required for importing/linking XLS worksheet and cell to the associated table/field).

That said, I am looking for a way that allows me to modify the Saved Import procedure vs. the need of having to recode all of the import process.

Any additional thoughts... e.g., where I could locate the code of the Saved Import procedure?

Thanks,
EEH
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40464650
I will suggest in the Click code for a button on a form.
0
 

Author Comment

by:ExpExchHelp
ID: 40464705
I'm not tracking... are you suggesting to create a blank form?   Or is there a shortcut (somewhere in the menu) that allows me to bring up the code for the stored procedure?

EEH
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 14

Expert Comment

by:ThomasMcA2
ID: 40464722
Instead of renaming every survey and processing them one at a time, build a script that combines all of the surveys into a single Survey.xlsm file.
0
 
LVL 24

Expert Comment

by:Phillip Burton
ID: 40464757
If I understand the question correctly, yes, I suggest creating a blank form with a button so that the user can start the process.
0
 

Author Comment

by:ExpExchHelp
ID: 40464767
ThomasMcA2:

Thanks for chiming in... do you have a recommendations for such script?

EEH
0
 
LVL 18

Accepted Solution

by:
Simon earned 500 total points
ID: 40469542
I'd suggest looking back at previous threads where this or very similar has been done before:
Can I update Access import specs via VBA
I have previously done a lot of importing multiple CSV files into Access using an import spec, and pulling data from folders full of Excel claim forms.
When processing regular batches of files it's also good to move the files that have been successfully imported into another folder so that they aren't processed again.
From memory I used DIR() as pointed to by Philip Burton to enumerate the files in the directory and the FileSystemObject to move the successfully processed ones to a new subdirectory.
0
 

Author Closing Comment

by:ExpExchHelp
ID: 40469579
Thank you... I appreciate your providing the link to the other solution.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

912 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

22 Experts available now in Live!

Get 1:1 Help Now