Results 1 to 7 of 7
  1. #1
    haggis999 is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Nov 2012
    Location
    Southampton, UK
    Posts
    60

    Question What is best way to add trailing periods to text in a report textbox?

    I have created an Access 2007 application for use in running an annual photographic competition. A newly designed report shows a list of print titles, whose length typically varies in the range 4 - 40 characters. To the right of each print name there is a checkbox that indicates whether we have received that print. However, with the shorter titles it can be more difficult to rapidly read which is the relevant checkbox, as they are so far apart.

    To resolve this problem, I would like to pad out all the titles with trailing periods. The padding would only apply for this report. Can anyone suggest a slick way to achieve this?

    David

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771

    String function to pad text

    I have a custom function (which I found on-line somewhere) to accomplish that:
    Code:
    Function Pad(varText As Variant, strAlign As String, intLength As Integer, Optional strFill As String = " ") As String
    If Len(varText) >= intLength Then
        'if the source string is longer than the specified length, return the Length left characters
        Pad = Left(varText, intLength)
    ElseIf strAlign = "L" Then
        'text aligns left, fill out the right with specified character
        Pad = varText & String(intLength - Len(varText), strFill)
    Else
        'text aligns right, fill out the left with specified character
        Pad = String(intLength - Len(varText), strFill) & varText
    End If
    End Function
    Or you can just do this in query or textbox:

    [title] & String(40 - Len([title]), ".")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    haggis999 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Southampton, UK
    Posts
    60
    Many thanks for your rapid response.

    I'll give that a try tomorrow morning. It's midnight here in the UK and my brain has already started its shutdown sequence...


    David

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    Why not use row shading? Something like shading every other line a light shade of gray, similar to the old white/light green form feed paper used to be. I think it may even be a built in function of 2007+

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I have row shading and the results vary from printer to printer. Some will show the shade and some don't. And then there is what happens to the shading in photocopies, not always nice either.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    The photocopying yes, there's that issue, but I've never really had issues with alternate row shading related to the printer. How odd.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Odd and annoying. I gave up trying to resolve. Nobody seems to really care about the shading either way.

    Seems all my worst printing issues have been with HP printers. Another thing an older device did was print text as bold italics in some bound controls in report header but the Konica did not. Weird thing about that was the report uses the same font throughout. Very odd, glad that printer is gone.

    And when we upgraded to Windows 7, Office 2010 and new printer drivers my code to designate destination printer tray no longer works. Really bummed out on that.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 06-18-2014, 09:39 PM
  2. Replies: 13
    Last Post: 01-15-2014, 02:37 PM
  3. Change Text in Textbox for Report
    By soccasnow in forum Reports
    Replies: 6
    Last Post: 01-25-2013, 02:19 PM
  4. Report TextBox printing ID Number, not text
    By ZipDoc in forum Reports
    Replies: 8
    Last Post: 02-01-2010, 12:30 PM
  5. Keeping text in a report textbox
    By Hawkx1 in forum Reports
    Replies: 2
    Last Post: 11-13-2008, 04:11 PM

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