G
Guest
I want to give the user the ability to add 1 to 3 new fields to a report.
When I run the code below, I find that the detail is okay. The problem is
with the headers and footers in the report. Nothing is being placed in the
section that I code.
HELP!
the code:
'**********
Cnt + 1 'tally of fields chosen
Select Case ctl.NAME
Case "chkSelect1" 'Outbound column
Set ctlLabel = CreateReportControl(RptName, acLabel,
acGroupLevel1Header, "", "", (8250 + (770 * Cnt)), 660, 750, 663)
ctlLabel.Caption = "Outbound Calls TalkTime"
ctlLabel.NAME = "lblAdd" & Cnt
ctlLabel.TextAlign = 2
ctlLabel.FontSize = 8
Set ctlText = CreateReportControl(RptName, acTextBox, acDetail,
"", "DNoutExtCallsTalkTime", (8250 + (770 * Cnt)), 240, 375, 270)
ctlText.NAME = "txtDailyA" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlText = CreateReportControl(RptName, acTextBox, acDetail,
"", "DNoutIntCallsTalkTime", (8625 + (770 * Cnt)), 240, 375, 270)
ctlText.NAME = "txtDailyB" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Case "chkSelect2" 'Inbound column
Set ctlText = CreateReportControl(RptName, acTextBox, acDetail,
"", "DNInExtCalls", (8250 + (770 * Cnt)), 240, 375, 270)
ctlText.NAME = "txtDailyA" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlText = CreateReportControl(RptName, acTextBox, acDetail,
"", "DNInIntCalls", (8625 + (770 * Cnt)), 240, 375, 270)
ctlText.NAME = "txtDailyB" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlLabel = CreateReportControl(RptName, acLabel,
acGroupLevel1Header, "", "", (8250 + (770 * Cnt)), 660, 750, 663)
ctlLabel.Caption = "Inbound Calls TalkTime"
ctlLabel.NAME = "lblAdd" & Cnt
ctlLabel.TextAlign = 2
ctlLabel.FontSize = 8
Case "chkSelect3" 'Talk Time column
Set ctlText = CreateReportControl(RptName, acTextBox, acDetail, "",
"TalkTime(min)", (8250 + (770 * Cnt)), 240, 750, 270)
ctlText.NAME = "txtDaily" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlLabel = CreateReportControl(RptName, acLabel,
acGroupLevel1Header, "", "", (8250 + (770 * Cnt)), 660, 750, 663)
ctlLabel.Caption = " TalkTime (min)"
ctlLabel.NAME = "lblAdd" & Cnt
ctlLabel.TextAlign = 2
ctlLabel.FontSize = 8
Set ctlText = CreateReportControl(RptName, acTextBox,
acGroupLevel1Footer, "", "=Sum([TalkTime(min)])", (8250 + (770 * Cnt)), 930,
750, 270)
ctlText.NAME = "txtTot" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlLabel = CreateReportControl(RptName, acLabel,
acGroupLevel1Footer, ctlText.NAME, "", (8250 + (770 * Cnt)), 465, 750, 465)
ctlLabel.Caption = "Total TalkTime"
ctlLabel.NAME = "lblTot" & Cnt
ctlLabel.TextAlign = 2
ctlLabel.FontSize = 8
If AssocSkill = "coach" Then
Set ctlText = CreateReportControl(RptName, acTextBox,
acGroupLevel2Footer, "", "=Sum([TalkTime(min)])", (8250 + (770 * Cnt)), 930,
750, 270)
ctlText.NAME = "txtTotC3"
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlLabel = CreateReportControl(RptName, acLabel,
acGroupLevel2Footer, ctlText.NAME, "", (8250 + (770 * Cnt)), 465, 750, 465)
ctlLabel.Caption = "Total TalkTime"
ctlLabel.NAME = "lblTotC3"
ctlLabel.TextAlign = 2
ctlLabel.FontSize = 8
End If
'*********
When I run the code below, I find that the detail is okay. The problem is
with the headers and footers in the report. Nothing is being placed in the
section that I code.
HELP!
the code:
'**********
Cnt + 1 'tally of fields chosen
Select Case ctl.NAME
Case "chkSelect1" 'Outbound column
Set ctlLabel = CreateReportControl(RptName, acLabel,
acGroupLevel1Header, "", "", (8250 + (770 * Cnt)), 660, 750, 663)
ctlLabel.Caption = "Outbound Calls TalkTime"
ctlLabel.NAME = "lblAdd" & Cnt
ctlLabel.TextAlign = 2
ctlLabel.FontSize = 8
Set ctlText = CreateReportControl(RptName, acTextBox, acDetail,
"", "DNoutExtCallsTalkTime", (8250 + (770 * Cnt)), 240, 375, 270)
ctlText.NAME = "txtDailyA" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlText = CreateReportControl(RptName, acTextBox, acDetail,
"", "DNoutIntCallsTalkTime", (8625 + (770 * Cnt)), 240, 375, 270)
ctlText.NAME = "txtDailyB" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Case "chkSelect2" 'Inbound column
Set ctlText = CreateReportControl(RptName, acTextBox, acDetail,
"", "DNInExtCalls", (8250 + (770 * Cnt)), 240, 375, 270)
ctlText.NAME = "txtDailyA" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlText = CreateReportControl(RptName, acTextBox, acDetail,
"", "DNInIntCalls", (8625 + (770 * Cnt)), 240, 375, 270)
ctlText.NAME = "txtDailyB" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlLabel = CreateReportControl(RptName, acLabel,
acGroupLevel1Header, "", "", (8250 + (770 * Cnt)), 660, 750, 663)
ctlLabel.Caption = "Inbound Calls TalkTime"
ctlLabel.NAME = "lblAdd" & Cnt
ctlLabel.TextAlign = 2
ctlLabel.FontSize = 8
Case "chkSelect3" 'Talk Time column
Set ctlText = CreateReportControl(RptName, acTextBox, acDetail, "",
"TalkTime(min)", (8250 + (770 * Cnt)), 240, 750, 270)
ctlText.NAME = "txtDaily" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlLabel = CreateReportControl(RptName, acLabel,
acGroupLevel1Header, "", "", (8250 + (770 * Cnt)), 660, 750, 663)
ctlLabel.Caption = " TalkTime (min)"
ctlLabel.NAME = "lblAdd" & Cnt
ctlLabel.TextAlign = 2
ctlLabel.FontSize = 8
Set ctlText = CreateReportControl(RptName, acTextBox,
acGroupLevel1Footer, "", "=Sum([TalkTime(min)])", (8250 + (770 * Cnt)), 930,
750, 270)
ctlText.NAME = "txtTot" & Cnt
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlLabel = CreateReportControl(RptName, acLabel,
acGroupLevel1Footer, ctlText.NAME, "", (8250 + (770 * Cnt)), 465, 750, 465)
ctlLabel.Caption = "Total TalkTime"
ctlLabel.NAME = "lblTot" & Cnt
ctlLabel.TextAlign = 2
ctlLabel.FontSize = 8
If AssocSkill = "coach" Then
Set ctlText = CreateReportControl(RptName, acTextBox,
acGroupLevel2Footer, "", "=Sum([TalkTime(min)])", (8250 + (770 * Cnt)), 930,
750, 270)
ctlText.NAME = "txtTotC3"
ctlText.TextAlign = 2
ctlText.FontSize = 8
Set ctlLabel = CreateReportControl(RptName, acLabel,
acGroupLevel2Footer, ctlText.NAME, "", (8250 + (770 * Cnt)), 465, 750, 465)
ctlLabel.Caption = "Total TalkTime"
ctlLabel.NAME = "lblTotC3"
ctlLabel.TextAlign = 2
ctlLabel.FontSize = 8
End If
'*********