Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Export Report Object (XP)

    My clients are allowed to modify reports in the front end database (there is no code behind). When they install a new front end we need to get their modified reports into the new front end. Unless you can suggest a better strategy, I need to copy the report object (not the data) into the back end after it i's modified. Then when a new version is installed it copies them back. I am having trouble with transferdatabase method and the help isn't much help. the example it has is -
    DoCmd.TransferDatabase acImport, "Microsoft Access", "C:My DocumentsNWSales.mdb", acReport, "NW Sales for April", "Corporate Sales for April"

    this doesn't have a path to the destination database and the help talks about import/exporting data not objects.

    here's the code I am trying to make work but I get an err 13 Type mismatch

    strSource = "CataFrontend.mdb"
    strDestination = "CataBackend.mdb"
    strObjectName = "rptDailySummary"
    strDatabaseType = "Microsoft Access"

    DoCmd.TransferDatabase , acExport, strDatabaseType, strSource, acReport, strDestination, strObjectName, strObjectName

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Export Report Object (XP)

    You have a superfluous comma immediately after DoCmd.TransferDatabase, causing all arguments to shift.

    Personally, I wouldn't use the backend database to store reports, even temporarily. Why not rename the old frontend and import directly from that into the new frontend?

    BTW, DoCmd.TransferDatabase can be used to import/export database objects. You're doing this when ObjectType is set to acReport.

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    387
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Export Report Object (XP)

    I didn't have the syntax quite right either.
    DoCmd.TransferDatabase acExport, "Microsoft Access", strExternalDataBase, acReport, strObjectName, strObjectName works.of course it only needs the path to the other database.
    Lot easier to work out when I got rid of the superfluous comma.
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •