Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename a Report in an ADP I've Set a Reference To

Status
Not open for further replies.

JeremyNYC

Programmer
Sep 23, 2002
2,688
US
I've got an application with an ADP front end and a SQL Server back end. To enable the users to share reports, there is a separate ADP that sits on the file server, and the front end file (one on each desktop) has a reference to this file. Because our release date for a new version of this is a few weeks ago, this setup won't change.

If I have the front-end ADP open and then open the reports.adp file, they both crash, with the dialog box asking if I want to repair the database, and whether or not I want to report the failure to MS. Not a problem, though--as we just don't do that.

If I use the following code, it just hangs on the line that starts ".openCurrentDatabase..."

Can anyone provide insight into what other ways I might try to rename the reports in the remote reports?

Thanks much.

Jeremy

Code:
Dim App As Access.Application
Dim dbs As Object
Dim strDBPath As String
Dim obj As Object
Dim strName As String

strDBPath = Application.CurrentProject.Path & "\reportsql.adp"
Set App = New Access.Application
With App
    .OpenCurrentDatabase strDBPath, False
    Set dbs = App.CurrentProject
    For Each obj In dbs.AllReports
        strName = obj.Name
        If left(strName, 3) <> "usr" Then
            Call .DoCmd.Rename("usr" & strName, acReport, strName)
        End If
    Next obj
End With

dbs.Close
Set dbs = Nothing
App.Quit acQuitSaveNone
Set App = Nothing

End Function

---
Jeremy Wallace
METRIX Project Coordinator
Fund for the City of New York
 
I've used the open project for an ADP.
In standard module.
Public pubAppAccess As Access.Application, pubOldAccess As Access.Application
Public pubFilePath As String

Public somefunction()
' Open Access project.
pubFilePath = "C:\Maindir\alaris\projects\localpubs.adp"
Set pubAppAccess = New Access.Application
pubAppAccess.OpenAccessProject pubFilePath

pubAppAccess.Application.RefreshDatabaseWindow
pubAppAccess.Application.Visible = True
DoCmd.Close
end function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top