Results 1 to 14 of 14
  1. #1
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Another multi column report question (Access XP)

    When you define the variables with their associated heading labels and then decide to make it multi column, is there a way to duplicate the column headings automatically across the page rather than having to do it manually.

    Doing it manually takes quite a deal of time to line them up.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Another multi column report question (Access XP)

    As far as I know, you're doomed to duplicate them manually.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Another multi column report question (Access XP)

    Curses, that's a real PITA having to do that.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Another multi column report question (Access XP)

    You could write an add-in to handle it... <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Another multi column report question (Access XP)

    The <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15> gives you away.

    I imagine that this would be fairly difficult to achieve. And I'm no too sure it would be worth it.

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

    Re: Another multi column report question (Access XP)

    I've always found copy and paste useful for this, Pat. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>
    Charlotte

  7. #7
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Another multi column report question (Access XP)

    Thanks Charlotte, that's how I do it, but you still have to line it up which can take quite a bit of time.

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

    Re: Another multi column report question (Access XP)

    If you copy all the controls at once, then it isn't a big deal to line them up in the other column, is it? Just select one of the equivalent controls from the first column as well as those you just copied and then use Format-->Align-->Top (or bottom, etc.).
    Charlotte

  9. #9
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Another multi column report question (Access XP)

    Formatting to the top is easy, the problem is aligning them to the left as you have nothing to align them to. You have to go in preview and back to design view and hope your finger on the screen is ok to align it to.
    It would be a whole lot easier if Access knew how many columns there were (developer input) and created the headings for you from the ones already created.

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Another multi column report question (Access XP)

    I have attached a text file with very rough code to propagate labels in the page header of a report. If you want to test it:

    - Download the attached file.
    - Make sure that you have a multi-column report with labels for the first column only in the page header section.
    - Make a backup copy of your database.
    - Import the text file into the Visual Basic Editor (File | Import File..., set Files of Type to All files; you can also copy/paste into a new module, but don't duplicate the Option ... lines)
    - Click inside the MultiColumnHeaders procedure.
    - Press F5 to run.
    - You will be prompted to enter the name of the report. Sorry, no fancy interface (yet).

    The code will read the column settings of the report, and copy the labels in the report header for columns 2, 3 etc. All other controls, such as lines, boxes etc. are left alone. When the code finishes, the report is left open in design view; you can test it by switching to Preview mode. The code does not save the report, so if you don't like the results, just close the report without saving it.

    There is much room for improvement, I just threw this together quickly. Comments and criticism welcome.

    Note: don't run the code twice on the same report - it would duplicate the already duplicated labels. There is no check against doing so.

  11. #11
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Another multi column report question (Access XP)

    Hans, don't you have any work to do?

    >>Comments and criticism welcome<<
    Are you kidding, I welcome your most generous contribution as others do as well.

    I will have a look at this asap.

    Thanks Hans

  12. #12
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Another multi column report question (Access XP)

    You cannot run this more than once. It does not allow you to save it after the first time.

    A few questions:
    What does the LSet line do?

    Do you need to set this to null?

    Do you need to close the report at the end of the code?

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Another multi column report question (Access XP)

    > It does not allow you to save it after the first time.

    That depends on the width of the report - if the repeated duplicating would make the report wider than 22 inches, you get an error message. The maximum height and width of 22 inches is hard-coded into Access.

    > What does the LSet line do?

    I copied most of the code for PrtMip straight from the online help. PrtMip is a binary structure consisting of 28 bytes; LSet is used to transfer this structure.

    > Do you need to set this to null?

    I'm not sure what you mean, but in general, you only need to set object variables to Nothing. The procedure does that.

    > Do you need to close the report at the end of the code?

    You could close the report, but I left it open without saving it on purpose: you can test the effect of the code by switching to print preview mode. If you don't like what the code has done, you can close the report without saving it, thereby undoing the changes made by the code. If you like, you can add a line

    DoCmd.Close acReport, strReportName

    You will be prompted whether you want to save changes. If you are satisfied that the code always works the way you want, you can even save the report automatically:

    DoCmd.Close acReport, strReportName, acSaveYes

  14. #14
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Another multi column report question (Access XP)

    Thanks you for the lucid (I think that's the word I'm looking for) reply.

    I will have to study it further to fully understand it.

    In one of the questions I meant to ask "Do you need to set the LSet to nothing?". But LSet is not used to set an object variable, so the question is not applicable.

Posting Permissions

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