Avatar of pdvsa
pdvsaFlag for United States of America

asked on 

Saved Import - assign to a button

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
Microsoft Access

Avatar of undefined
Last Comment
pdvsa
Avatar of PatHartman
PatHartman
Flag of United States of America image

In the click event of the button, add the DoCmd.Transfer????, reference your saved import spec.
use this command

DoCmd.RunSavedImportExport "Name Of SavedImportExport"
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of PatHartman
PatHartman
Flag of United States of America image

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.
Avatar of pdvsa
pdvsa
Flag of United States of America image

ASKER

Thank you.  Sorry for my tardy reply....
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo