Results 1 to 6 of 6
  1. #1
    BruceUK is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Sep 2011
    Posts
    48

    Controlling line spacing when reporting text items of variable length

    I'm using Access 2003 under Windows 7 Home Premium.



    I have a basic report on which I'm printing a list of many text items, which will extend to several pages. The lengths of text vary considerably and may be anything up to around 400 characters. The relevant field is therefore defined with a data type 'Memo' in the source table.

    If the text for a particular record is too long to be accommodated within a single line on the report, it is automatically wrapped onto as many continuation lines as are needed.

    For various reasons, it is important that each page of the report shows the same overall number of lines (including continuation lines). I therefore need the line spacing to be exactly the same between the lines for consecutive records and between consecutive continuation lines within the same record. I'm having great difficulty in achieving this.

    Unless I'm missing something, it seems to be a matter of correctly setting values for the following properties: the Height for the Detail section of the report and the Height and Line Spacing properties of the text box control. I've tried various combinations of these values, but the spacing of the continuation lines never seems to quite match the spacing between the last line of one record and the first line of the next record.

    Can anyone explain the correct approach for achieving this? I'll be very grateful for any help!

  2. #2
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    Can't picture the result or desired outcome. I might be stymied by your use of the word line in what seems to be more than one context, meaning I'm not sure when it means a line of text in a control, a record row in the report or what.
    it is important that each page of the report shows the same overall number of lines
    If this means records, I don't see how it's possible given that some records seem to have expanded textbox height due to the number of lines within the textbox. This means that some records on page one could be, for example, 2" tall while others are only .50 tall, while on page two, all are 2" tall. There's no way to get the same number of "lines" on each page if lines means records.

    Furthermore, your post title suggest it is the spacing between lines you are after, not the number of lines on a report page. If that's the case, it's governed by the amount of space below the bottom most row of controls for a record and the next divider - be that a grouping section or footer.
    Last edited by Micron; 07-14-2017 at 01:13 PM. Reason: added info
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    BruceUK is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Sep 2011
    Posts
    48
    Hi Micron,

    Thanks for the quick reply. I'll try to make myself clearer.

    When I refer to 'lines', I mean the actual physical lines of text that will appear on each page of the report. These can include continuation lines where the text in a particular record is too long to be accommodated within one physical line on the page.

    In the report definition, the Detail section contains the text box control for the text. I've set up the Detail section as just deep enough to accommodate a single physical line of text. The Can Grow property of the text box control is set to 'yes', so Access is automatically wrapping the text for a particular record onto continuation lines if necessary. I've set the Height of the Detail section to be the same as the Height of the text box control. So if the text for every record were short enough to fit on just one physical line, there would be a fixed number of physical lines of text on each page of the report.

    I then need to consider the spacing of the physical lines of text within one record if continuation lines are present. How is this controlled? As far as I can see, it depends on the value of the Line Spacing property of the text box control. The default value is zero but, with this value, the space between consecutive continuation lines for the same record is slightly smaller than that between consecutive records.

    So maybe I just need to experiment with different settings of the Line Spacing property until I happen to hit on one that works. This seems a rather random procedure though, so I'm wondering whether I'm missing a better approach.

    I hope I've managed to explain this better now. Any further thoughts or suggestions would be much appreciated!

  4. #4
    BruceUK is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Sep 2011
    Posts
    48
    I've now realised that the Line Spacing property of the text box control also determines the spacing of the physical lines between consecutive records as well as the spacing of continuation lines within a record. So now, I'm quite confused. It seems that there are two ways of controlling line spacing between records. One is to vary the Height property of the Detail section of the report and the other is to vary the Line Spacing property for the text box control. How should these be used in conjunction with one another?

  5. #5
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    it is important that each page of the report shows the same overall number of lines
    Based on your further explanation, I'd say there's no way you can control this - at least not in a practical way. You can determine similar things like this during the report's format event but every time the code makes a change to the number of lines, it would have to be recalculated (formatted again) which certainly would add time to the report opening. I don't know how you'd even begin, but I can't imagine a situation where the number of lines (not records) would have to be any more exact than what would naturally fit between the header and footer. I think about the only thing you can do is play with the height and location of space between your row of controls (and space before or after any grouping sections). I was thinking the height of the controls might be a factor as well, but probably not since they are allowed to grow. In other words, any vertical space involved does not have to go only below the controls where the controls are jammed up against the top detail border. Space can go above those controls as well as above and below.

    That's about all I can suggest.

  6. #6
    BruceUK is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Sep 2011
    Posts
    48
    Quote Originally Posted by Micron View Post
    Based on your further explanation, I'd say there's no way you can control this - at least not in a practical way. You can determine similar things like this during the report's format event but every time the code makes a change to the number of lines, it would have to be recalculated (formatted again) which certainly would add time to the report opening. I don't know how you'd even begin, but I can't imagine a situation where the number of lines (not records) would have to be any more exact than what would naturally fit between the header and footer. I think about the only thing you can do is play with the height and location of space between your row of controls (and space before or after any grouping sections). I was thinking the height of the controls might be a factor as well, but probably not since they are allowed to grow. In other words, any vertical space involved does not have to go only below the controls where the controls are jammed up against the top detail border. Space can go above those controls as well as above and below.

    That's about all I can suggest.
    Many thanks for replying. I must admit I'd come to the same conclusion after further experimenting.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-06-2019, 12:59 PM
  2. Reporting: Text Box Spacing
    By kware in forum Reports
    Replies: 3
    Last Post: 05-11-2016, 07:03 AM
  3. Replies: 2
    Last Post: 06-28-2014, 01:16 PM
  4. line spacing in access 2010
    By Alexander Pooh in forum Access
    Replies: 5
    Last Post: 08-15-2012, 08:13 AM
  5. Replies: 1
    Last Post: 01-12-2012, 02:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums