[AccessD] Change a property on all reports

cjlabs cjlabs at att.net
Sun Aug 6 20:47:19 CDT 2017


I want to change the Close Button property on all reports to Yes.

Here are 2 methods I have tried.  Both open each report, but the Close button property is not changed.

Can someone help me out with the correct way to do this?  I though adding the property would be the way to go.



Public Sub UpdateReportProperty()
Dim rpt As Object

    For Each rpt In Application.CurrentProject.AllReports
        DoCmd.OpenReport rpt.Name, acViewDesign
        rpt.Properties.Add "CloseButton", True
        DoCmd.Close acReport, rpt.Name, acSaveYes
    Next
   
End Sub 



Public Sub UpdateReportProperty()
Dim i As Integer

    For i = 0 To CurrentProject.AllReports.Count - 1
        DoCmd.OpenReport CurrentProject.AllReports.Item(i).Name, acViewDesign
        CurrentProject.AllReports.Item(i).Properties.Add "CloseButton", True
        DoCmd.Close acReport, CurrentProject.AllReports.Item(i).Name, acSaveYes
    Next i   

End Sub


Thanks
Carolyn Johnson




More information about the AccessD mailing list