Setting path of TransferDatabase Macro

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dileshw
    New Member
    • Oct 2009
    • 21

    Setting path of TransferDatabase Macro

    Hi,
    I have a database saved in ""D:\Database\v 101" and some macros that import/export (transferSpread sheet) the tables of it. These tables (approx 30 tables) are saved in a location "D:\Database\v1 01\tables".

    After going through it with the user and I need to update it I create a new version and save that in "D:\Database\v1 02". Now the tables I export\import from the DB are should be saved into location "D:\Database\v1 02\tables".

    The save location for the macros are hard coded in the macros. Is there a way that I can in one go set the save path in all the macros to "D:\Database\v1 02\tables" rather than going into the design view of each macro and manually changing it? Currently I have had 4 such new releases and each time i have had to manually change the macros. So imagine 30(tables)*2(im port/export)= 60 macros to change with every release. Thats a LOT of work! Appriciate the help!
    Last edited by dileshw; Sep 20 '10, 02:04 AM. Reason: entered macro type
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32661

    #2
    Use CurrentProject. Path in your macro code to refer to the current folder.

    Comment

    • dileshw
      New Member
      • Oct 2009
      • 21

      #3
      Hi,
      I tried "CurrentProject .Path" but it didnt work.
      Basically the excel files should be exported to a subflder within the folder in which the database is.

      Eg:
      Database is in D:\Database\v10 0
      Tables should goto D:\Database\v10 0\exported

      But I get an error saying the path is not valid. (but all the folders are created and paths are corrects)

      basically I said the destination should be
      CurrentProject. Path\exported

      Am I doing something wrong?

      Comment

      Working...