Solved

Saved Import - assign to a button

Posted on 2014-11-06
5
203 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 35

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 500 total points
ID: 40426233
private sub button1_click()

DoCmd.RunSavedImportExport "Name Of SavedImportExport"

end sub
0
 
LVL 35

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

809 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