?
Solved

Saved Import - assign to a button

Posted on 2014-11-06
5
Medium Priority
?
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 38

Expert Comment

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

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40426227
use this command

DoCmd.RunSavedImportExport "Name Of SavedImportExport"
0
 
LVL 120

Accepted Solution

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

DoCmd.RunSavedImportExport "Name Of SavedImportExport"

end sub
0
 
LVL 38

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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
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 …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

770 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