Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Export all reports (Access 2000)

    My function for exporting all reports is not working.Would yo help me find the reason ?

    Private Function ExportAllObjects()
    Dim Rpt As AccessObject

    For Each Rpt In CurrentProject.AllReports
    DoCmd.TransferDatabase acExport, "Microsoft Access", StrSurvey, acReport, Rpt.Name, Rpt.Name
    Next Rpt
    End Function

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export all reports (Access 2000)

    What is StrSurvey ? Is that the name of the database where you want to export to ?
    Francois

  3. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export all reports (Access 2000)

    strSurvey is a constant, but i will replace it below with the path. The function below exports all the objects except the reports. This happened recently.I used it so many times but it is only now that i have these sudden problems. Because, if i use this function it in a separate database, then it works. But i cannot explain myself why this function is not working properly in my original database?
    Private Function ExportAllObjects()
    Dim frm As AccessObject
    Dim Rpt As AccessObject
    Dim mcr As AccessObject
    Dim Mdl As AccessObject

    For Each frm In CurrentProject.AllForms
    If Not frm.Name = "frmUpsize" Then ' do not export the form "frmUpsize"
    DoCmd.TransferDatabase acExport, "Microsoft Access", "C:BEMGPSurveySurvey.mdb", acForm, frm.Name, frm.Name
    End If
    Next frm

    For Each Rpt In CurrentProject.AllReports
    DoCmd.TransferDatabase acExport, "Microsoft Access", "C:BEMGPSurveySurvey.mdb", acReport, Rpt.Name, Rpt.Name
    Next Rpt

    For Each mcr In CurrentProject.AllMacros
    If Not mcr.Name = "AutoexecUpsize" Then
    DoCmd.TransferDatabase acExport, "Microsoft Access", "C:BEMGPSurveySurvey.mdb", acMacro, mcr.Name, mcr.Name
    End If
    Next mcr
    For Each Mdl In CurrentProject.AllModules
    DoCmd.TransferDatabase acExport, "Microsoft Access", "C:BEMGPSurveySurvey.mdb", acModule, Mdl.Name, Mdl.Name
    Next Mdl

    End Function

  4. #4
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Export all reports (Access 2000)

    This should work. Have you try a Compact and Repair ?
    Francois

Posting Permissions

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