Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Syntax to change Lbl Caption on Rpt from Form

    I'm trying to modify a report from and event on a form.
    When the user selects the options they want I want to change the header label on the report. I have opened the report in design mode but I am having no luck in getting the syntax right for the changing the caption. Here is what I'm trying to do:

    RptName = "rpt_All_Items"
    DoCmd.OpenReport RptName, acViewDesign
    If Me.Frame_RptOpt > 0 Then
    Select Case Me.Frame_RptOpt.Value
    Case 1 ' All Items
    If IsNull(Me.cbxBills) Then
    Reports(RptName).RecordSource = "qry_All_Items_Veto_Rest_Union"
    Reports(RptName)!lableHeader.Caption = "All Bills / All Items" <span style="background-color: #FFFF00; color: #000000; font-weight: bold"><---<<< Problem</span hi>
    Else
    Reports(RptName).RecordSource = "qry_All_Items_Veto_Rest_Bill_Option"
    Reports(RptName)!lableHeader.Caption = "All Items" <span style="background-color: #FFFF00; color: #000000; font-weight: bold"><---<<< Problem</span hi>
    End If
    .
    .
    .
    Else
    MsgBox "Please select a report option."
    Me.Frame_RptOpt.SetFocus
    Exit Sub
    End If
    DoCmd.Close acReport, RptName, acSave
    DoCmd.OpenReport RptName, acViewPreview

    Thank you
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Syntax to change Lbl Caption on Rpt from Form

    Why not set the labels in the Open event of the report? Something like <code>If Me.Recordsource = "qry_All_Items_Veto_Rest_Union" Then Me)!lableHeader.Caption = "All Bills / All Items"</code> should work.
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Schenectady, New York, USA
    Posts
    273
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Syntax to change Lbl Caption on Rpt from Form

    Thank you Charlotte, <img src=/S/bingo.gif border=0 alt=bingo width=15 height=22>

    Sometimes when under pressure I guess we just miss the obvious other options because we're so focused on what we are trying to do.

    Have a nice day. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    As I said sometimes the obvious is missed. The problem was I had LableHeader instead of LabelHeader. <img src=/S/stupidme.gif border=0 alt=stupidme width=30 height=30>
    Don
    <img src=/S/flags/USA.gif border=0 alt=USA width=30 height=18> <img src=/S/flags/NewYork.gif border=0 alt=NewYork width=30 height=18> "Life on Earth is expensive, but at least it includes a free trip around the Sun."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •