A
alexrs2k
I'm trying to put a logo fo the company in report header which is created
with code, but when it gets to the Set imgLogo, it triggers an error "The
section number is invalid". Whenever I use the instruction
rpt.Section(acHeader).Height = 300, triggers the same error.
The section number for the report Header is acHeader . Any idea how to refer
to the report header section programmatically. Thank you.
'Create the report
Set rpt = CreateReport
' set properties of the Report
With rpt
.Width = 8500
.Section(acDetail).Height = 300
.RecordSource = strSQL
End With
' Open SQL query as a recordset
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL)
' Create Logo
Set imgLogo = CreateReportControl(rpt.Name, acImage, acHeader, , , 0, 0)
imgLogo.Picture = Application.CurrentProject.Path & "\Images\Logo.JPG"
imgLogo.SizeToFit
with code, but when it gets to the Set imgLogo, it triggers an error "The
section number is invalid". Whenever I use the instruction
rpt.Section(acHeader).Height = 300, triggers the same error.
The section number for the report Header is acHeader . Any idea how to refer
to the report header section programmatically. Thank you.
'Create the report
Set rpt = CreateReport
' set properties of the Report
With rpt
.Width = 8500
.Section(acDetail).Height = 300
.RecordSource = strSQL
End With
' Open SQL query as a recordset
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL)
' Create Logo
Set imgLogo = CreateReportControl(rpt.Name, acImage, acHeader, , , 0, 0)
imgLogo.Picture = Application.CurrentProject.Path & "\Images\Logo.JPG"
imgLogo.SizeToFit