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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

labels at runtime in report header section 1

Status
Not open for further replies.

SPC03

Technical User
Feb 28, 2003
4
US
Hi,
I am trying to create labels in report header section at runtime. The number of labels vary each time. I am using code like this.
DoCmd.OpenReport "Report1", acViewDesign

Set rpt = Reports("Report1")

Set lblNew = CreateReportControl(rpt.Name, acLabel, acHeader, _, , 500, 600, 1200, 1500)
lblNew.SizeToFit
lblNew.Caption = "This Is label"
lblNew.FontSize = 15

But i get the error saying "the number you entered for report section is invalid"
istead if i use acDetail instead of acHeader it works. But then it puts the labels at each record, i want them to be displayed only once. any one knows how to do that?
 
Without looking at your report it seems that the Report Header section is not being recognized. You are using acHeader which indicates that you want the control placed at the location indicated in the Report Header. Look very carefully in the design view of your report and see if you have a Report header or do you have a PageHeader indicated. You must select Report Header and Footer to have them included in the design.

Let me know what you find out. Bob Scriver
 
thank you Scriverb!
You are right,I had a page header section and i was trying to put label in report header section.Thanks again.
SPC03
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top