Solved

Saved Import - assign to a button

Posted on 2014-11-06
5
199 Views
Last Modified: 2014-11-07
Experts, how can I call up a saved import through an event on a forms button?

I have to do this manually and want to assign this saved task to a button.  

thank you
0
Comment
Question by:pdvsa
  • 2
  • 2
5 Comments
 
LVL 34

Expert Comment

by:PatHartman
ID: 40426204
In the click event of the button, add the DoCmd.Transfer????, reference your saved import spec.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 40426227
use this command

DoCmd.RunSavedImportExport "Name Of SavedImportExport"
0
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 40426233
private sub button1_click()

DoCmd.RunSavedImportExport "Name Of SavedImportExport"

end sub
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 40426267
Although it seems that the RunSavedImportExport method is easier, keep in mind that you have no way to change it at run time.  So for example, if you are doing an export and you want to include the date as part of the file name, you can't do that with RunSavedImportExport.  You have to use the Transfer... method so you can include a different file name each time you export.

Also, the RunSavedImportExport is more fragile.  I just changed the code one of my clients wrote to use the TransferText because he doesn't have any control over the file he is receiving and the maker added two new columns.  The TransferText method (if you are importing a .csv file) doesn't fail.
0
 

Author Closing Comment

by:pdvsa
ID: 40428230
Thank you.  Sorry for my tardy reply....
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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

932 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

13 Experts available now in Live!

Get 1:1 Help Now