Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    344

    Cannot see how to use Saved Imports

    I'm (attempting) to improve my DB by starting anew and importing many of the components. Access offers "Do you want to save these import steps? This will allow you to quickly repeat the operation without using the wizard." but I cannot find what to do to save browsing to the db each time.


    I suspect "Saved Imports" is the start, it shows the db I want, but no way to choose what component. And if I click RUN it tells me All objects were imported successfully but actually has imported nothing.
    Anyone know how this should work ?

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    You’ve only got to Google it - for example

    https://docs.microsoft.com/en-us/off...edimportexport

  3. #3
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722

  4. #4
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    344
    Very odd, maybe in those links there are the answers but I certainly can't find them. That first one I had seen... and Google can be worse than useless. I never ask a question here without first having looked elsewhere.

  5. #5
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    Did you read it?
    RemarksThis method has the same effect as performing the following procedure in Access:

    1. On the External Data tab, choose either Saved Imports or Saved Exports.
    2. In the Manage Data Tasks dialog box, on the Saved Imports or Saved Exports tab (depending on your choice in the preceding step), choose the specification that you want to run.
    3. Select Run.

    Before running the RunSavedImportExport method, make sure that the source and destination files exist, the source data is ready for importing, and the operation will not accidentally overwrite any data in your destination file.

  6. #6
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    344
    Quote Originally Posted by CJ_London View Post
    Did you read it?
    Aye, with increasing despair as I realised it wasn't telling me what I wanted !
    Yes I had followed those steps outlined and as said in msg 1 after RUN it tells me All objects were imported successfully.
    The problem with that was I wasn't given an opportunity to chose what to import, and it had imported nothing, or at least nothing that wasn't already there.
    When it tell me This will allow you to quickly repeat the operation without using the wizard I took this to mean it'd save me browsing to the folder with the source db every time ?
    But perhaps it meant something else entirely ?

  7. #7
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    perhaps time for you to clarify in detail what you are trying to do as it sounds to me all you need is a linked table to your file, then when you want to import another file, replace the old file with the new one.

  8. #8
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    344
    @CJ. Kind of.. DB1 is my experimental file with a ton of junk as I try things out. DB2 is the 'real' one with all the good proven routines. If I want to put something from DB1 into DB2 I open DB1, copy. close it then open DB2 and paste. Possibly both could be open at once but haven't tried that. If an entire Form or query etc is wanted I use External Data-New Date Source-From Database-Access- then Browse to DB1, select the component and Import. It's bit of a mission repeatedly.... "Saved Import Steps" seemed a better way as Access hinted at quickly repeat the operation. But results were not as expected and Googling didn't help. Asking here was the next step.

  9. #9
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    don't think the wizard is the way to go since you cannot change the objects specified - and if run again will will simply reimport the objects, renaming them with a numeric suffix rather than overwriting them if they already exist.

    May be possible to find the import spec (see Orange's link) and edit then save it, but seems a lot more work than simply having to copy paste.

    If you want to spend the time, you could create your own routine - a table to store the path, another to store the objects you want to import and a form to manage the process.

  10. #10
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Middlemarch,

    Perhaps you could use DoCmd.CopyObject to accomplish moving objects from DB1 to DB2.
    You could set it up as a function and just pass the object names and have database names as constants.

    I think we need to see an example of what you are doing. Maybe Import/Export specs is not the best choice??

  11. #11
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    344
    @CJ Thanks. Yes, that suggestion looks complex and may be easier to keep copy/pasting. I still don't see what SavedImports is supposed to do. certainly not what it implies. My best guess is it re-imports the last manual import. But if you want something else (from the same external source) you still have to do it manually. After RUN I see no new numeric suffix or any indication it's done anything.
    I tried again but still couldn't make any sense of that link from @Orange... it was like the writer is talking about something else entirely. Thank you for the DoCmd.CopyObject suggestion. I'm just about to try that out. Apart from previous description hard to give an example as just using the inbuild Access functions to move things from one DB to another.

  12. #12
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    Does what I would expect - you save an import process to import some objects, you run the saved import and it and it imports exactly the same objects again. The fact the objects were not deleted before importing adds a 1 suffix.
    After RUN I see no new numeric suffix or any indication it's done anything.
    Close the manage data tasks window.
    Click image for larger version. 

Name:	image_2022-09-13_011302281.png 
Views:	12 
Size:	32.6 KB 
ID:	48703 Click image for larger version. 

Name:	image_2022-09-13_011129289.png 
Views:	12 
Size:	31.8 KB 
ID:	48702

    Not sure what you expect? That it will know you only want to import one of the two objects in the saved import? To overwrite an object with the same name?

    What it is not doing is setting up a link to a specified file for you to pick and choose what objects to import.

  13. #13
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    344
    @CJ Yes I did expect it to allow to choose which objects. Mine are different each time so it's not what I want.
    I just tried it again and it will not rename or add a suffix here with Access 2019. It says All objects imported successfully (what objects are not shown). The suffix is added if you import again manually.
    I can't duplicate your Animals1. Unless I'm importing nothing... although the Save Steps box is ticked.

  14. #14
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    344
    @orange, I've successfully copied a module from DB1 to DB2 with DoCmd.CopyObject so thank you, this will do nicely
    But a question about these Microsoft Docs - when they say
    expression.CopyObject (DestinationDatabase, NewName, SourceObjectType, SourceObjectName)
    expression A variable that represents a DoCmd object.
    What is "expression" exactly ? I ended up with
    Code:
    DoCmd.CopyObject "D:\DBs\Test.accdb", , acModule, "Module3"
    And I had to remove the brackets else it wanted "="
    Also the instructions for Destination Database say "To select the current database, leave this argument blank"
    But doesn't say in that case where you specify the From database.





  15. #15
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Middlemarch,

    I would read it as:
    -you are in the current database,
    -you can select an object to copy to
    a) a different database, or
    b) the same database
    -you can rename the object that you are copying.

    Bottom line, you are in the FROM database when/where you have your DoCmd.CopyObject

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Macro to run saved imports
    By Ant_Snell in forum Macros
    Replies: 1
    Last Post: 07-28-2021, 05:43 AM
  2. Saved Imports with Changing File Names
    By Johnny12 in forum Access
    Replies: 7
    Last Post: 06-10-2021, 04:41 PM
  3. Databases/Queries associated with Saved Imports/Exports
    By moody6086 in forum Import/Export Data
    Replies: 1
    Last Post: 08-16-2019, 09:06 AM
  4. Changing File Location in saved imports using VBA
    By akshatagarwal93 in forum Import/Export Data
    Replies: 3
    Last Post: 07-23-2012, 10:47 AM
  5. Access 2010 Saved Imports
    By Tomfernandez1 in forum Access
    Replies: 1
    Last Post: 09-27-2011, 12:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums