Results 1 to 5 of 5
  1. #1
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post
    Sometime in the past, this database was written with 10 similar reports; each highlighting one label by shading. The only other difference is the Titles. Changing the titles in the Open event of the report is easy. Choosing a label to highlight is proving harder.

    I have built a Master Report and plan to change the Title and the highlighted label “on the fly.”
    Code:
        theCurrentTitle = "Buy/Sell Code-Options Validation Report"
        Title2Text = "Report for Trade Codes: 3, 4 , 5, 6, D, E, F, G"
        HighlightLabel = Reports("rptmaster").xxxx                      'Problem here
      '  DoCmd.OpenReport "rptBuySellCode_Options", acViewPreview, "", "", acNormal
        DoCmd.OpenReport "rptMaster", acViewPreview, "", "", acNormal
    Suggestions?
    Alan

  2. #2
    3 Star Lounger
    Join Date
    Jun 2001
    Location
    Salem, Oregon, USA
    Posts
    219
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What does the "xxxx" stand in place of?
    I don't remember this, as I usually re-learn it only when I have to, but can you paint the highlight via report code in the "on format" or "on print" events?
    Pat

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    What version of Access are you using? Later versions allow you to pass a parameter to a report using OpenArgs

    Code:
    theCurrentTitle = "Buy/Sell Code-Options Validation Report"
     Title2Text = "Report for Trade Codes: 3, 4 , 5, 6, D, E, F, G"
     strHighlightLabel = "xxx" 'Problem here
     DoCmd.OpenReport "rptMaster", acViewPreview, "", "", acNormal,strHighlightlabel
    Then the report could loop through its labels, comparing their name with Openargs, and hightlight the one that matches.
    Regards
    John



  4. #4
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post
    Using Access 2007. The XXX was representing an instruction I could not find.

    Been a while since I used OpenArgs.

    ==========
    On one kind of report, I need to set one label to background shade; on a different iteration, I will be setting a different label. Can I do this withut having 8 versions of essentially the same report??
    Alan

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    OpenArgs is one way to pass a parameter to a report. Things get more complicated if you need to pass multiple bits of data.

    One option is to put the various bits of data into the one string, that is passed using OpenArgs. The report would then have to parse this to extract the various bits.

    My preference is to launch the report from a form, and have the various options selected on the form. Leave the form open when the report is launched, and the report can check the options directly on the form.

    e.g.
    Select Case Forms("frmMenu")!optSelect

    in the On Open event of the Report


    I was not sure what your XXX was. I just used it as the name of the Label you wanted highlighted.
    Regards
    John



Posting Permissions

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