R
Robert Trout
I have a VB 6 application that uses automation to open an Access report,
modify a label's caption on the report, and then export the report.
All works fine but for modifying the label's caption on the report from VB
6. The exported report appears as if the label's caption was never changed.
However, stepping through the VB 6 code and inspecting the access report,
the caption is changed appropriately.
The VB 6 code used to change the caption follows:
Dim objAccess as Access.Application
Dim objReport As Access.Report
Dim ctlLabel As Access.Label
' Start access
Set objAccess = New Access.Application
' Open report in design view to change label caption
objAccess.DoCmd.OpenReport "TestReport", acViewDesign
' Get a reference to the open report
Set objReport = objAccess.Reports.Item("TestReport")
' Get the label whose caption is to be changed
Set ctlLabel = objReport.Controls("Vessel")
' Change the caption
ctlLabel.Caption = "Test Name"
Why does this code not change the label's caption as evidenced by the
exported report not having the "Test Name" caption?
Thanks for your help.
Robert
modify a label's caption on the report, and then export the report.
All works fine but for modifying the label's caption on the report from VB
6. The exported report appears as if the label's caption was never changed.
However, stepping through the VB 6 code and inspecting the access report,
the caption is changed appropriately.
The VB 6 code used to change the caption follows:
Dim objAccess as Access.Application
Dim objReport As Access.Report
Dim ctlLabel As Access.Label
' Start access
Set objAccess = New Access.Application
' Open report in design view to change label caption
objAccess.DoCmd.OpenReport "TestReport", acViewDesign
' Get a reference to the open report
Set objReport = objAccess.Reports.Item("TestReport")
' Get the label whose caption is to be changed
Set ctlLabel = objReport.Controls("Vessel")
' Change the caption
ctlLabel.Caption = "Test Name"
Why does this code not change the label's caption as evidenced by the
exported report not having the "Test Name" caption?
Thanks for your help.
Robert