Results 1 to 4 of 4
  1. #1
    lexi
    Guest

    report for a 1 to many

    I'm needing when a subreport has more than one value, to be able to put them as

    value 1/value2/value3 rather than each one as a separate line in detail section

    Any suggestions?

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

    Re: report for a 1 to many

    If you want to display them in separate fields, try using a crosstab query as the recordsource for your subreport. Look in the Solutions.mdb that comes with Access (Solutions9.mdb for Access 2000) and select the "Create advanced reports" selection for one example.

    If you want to create a concatenated string (like "Value1/Value2/Value3"), that's a different thing entirely and could most easily be done with a function.
    Charlotte

  3. #3
    lexi
    Guest

    Re: report for a 1 to many

    yes, I'm looking for the ability to create a concatinated answer.

    Lexi

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

    Re: report for a 1 to many

    Then you can use a subreport based on a crosstab query, assuming that you have a limited number of possible values. In the subreport's detail section, put a textbox in that is bound to an expression something like this:

    =[strValue1] & ("/" + [strValue2]) & ("/" + [strValue3])

    ... where [strValue1], etc, are column headings in the crosstab query. You actually reference the underlying field names here, not controls, so be sure you don't have any controls named [strValue1]...etc. The use of + operators assumes that some of the crosstab fields are going to return nulls, which will return a null for that part of the expression and not print extra slashes.

    Make sure that you use the columnheadings property of the crosstab query to specify ALL the field names that might occur, since you can only bind a crosstab-based subform or report if the columnheadings have been specified.

    If you may have any number of variations on the fields, post again and I'll tell you some ways to deal with that.
    Charlotte

Posting Permissions

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