MS Access - Set Default Database Folder using VBA

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MJC22
    New Member
    • Mar 2010
    • 4

    MS Access - Set Default Database Folder using VBA

    Hi,

    I am creating rtf files in MS Access and I would like to know how to change the location of the saved files. Currently, they are being saved in my default database folder.

    The following code is used to generate the rtf file:

    DoCmd.OutputTo acOutputReport, "rptEmploye e", acFormatRTF, "Employee.r tf", True

    I want to save the file to a folder which is located in the same location of my front end. I am using the following code to find the location of the front end.

    Dim MyPath
    MyPath = Application.Cur rentProject.Pat h


    I would be grateful if someone could help me put these two together.

    Kind regards,

    Mike
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    Code:
    Dim MyPath
    
    MyPath = CurrentProject.Path & "\Employee.rtf"
    
    DoCmd.OutputTo acOutputReport, "rptEmployee", acFormatRTF, MyPath, True

    Comment

    Working...