Results 1 to 9 of 9
  1. #1
    jsqsh is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2017
    Posts
    3

    replace cut-off text with other text in access report


    Hello guys, this is my first thread. I have been trying to figure out how to do this for a while now, and got to the end of my rope and figured it was time to let the question out into the world.

    I have a report in access that displays certain information from a database, in a limited amount of space. So what I have to deal with is certain things getting cut off when they're displayed. What I would like to be able to do is, rather than having a name "John James Doe" Cut off to "John James D", I would like to trim off from that last space in the manner "John James" or "John James..." with the three dots letting those reading the reports know that the field was cut off. Is anyone able to suggest how to do this?

    Click image for larger version. 

Name:	example.png 
Views:	8 
Size:	941 Bytes 
ID:	31074
    That tiny picture is an example, where "J & C CAMPBELL INVESTMENT COMPANY" Was cut off, and Hood is the start of a new field. Would like it to say "J & C CAMPBELL INVESTMENT..." or such.

    Any help is appreciated, thanks guys. These are just standard text boxes by the way.

  2. #2
    Join Date
    Apr 2017
    Posts
    1,776
    Simply have in table where you register those names a field for short name, and in your report use this short name instead of full one.

  3. #3
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,706
    Code:
    Private Sub Form_Current()
        If Len(Text10) > 12 Then
            Text10 = Left(Text10, 9) & "..."
        End If
    End Sub
    Determine the length that the textbox allows and adjust the above to fit.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Could do IIf() in query or textbox and no VBA needed.
    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.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    jsqsh,

    What do you do with names such as
    Oscar de la Hoya?
    John Paul Jones BSc.?
    Marco Dal Santo?

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    jsqsh,

    The point orange is driving at is doesn't matter if the last word is removed, some values not going to fit the restricted space and will appear truncated. I think davegri's suggestion is a reasonable compromise. Limit display to a set number of characters regardless of where the cutoff is and then append ellipsis "..."
    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.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    I agree June.

    jsqsh,
    Who will be reviewing the report? Do truncated names create an issue?
    Do the names have meaning to the users?

  8. #8
    jsqsh is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2017
    Posts
    3
    Quote Originally Posted by ArviLaanemets View Post
    Simply have in table where you register those names a field for short name, and in your report use this short name instead of full one.
    Good suggestion, that would definitely work and I don't know why I didn't think of that.

  9. #9
    jsqsh is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Nov 2017
    Posts
    3
    orange,

    those viewing the report will be varied, but the data it refers to will have a unique key provided for each entry, so having a truncated name shouldn't be an issue. I just want it to be obvious to the reader that they aren't looking at the full name, and I figure the ellipsis would be a good way to do that.

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

Similar Threads

  1. Hide/Replace numeric value with text value
    By gaker10 in forum Reports
    Replies: 2
    Last Post: 03-13-2015, 09:19 AM
  2. Replies: 5
    Last Post: 01-20-2014, 08:51 AM
  3. Replies: 2
    Last Post: 07-21-2012, 01:21 AM
  4. Replies: 1
    Last Post: 06-04-2012, 04:31 PM
  5. Replace a string/text in ms-access db
    By anziga in forum Queries
    Replies: 4
    Last Post: 12-31-2010, 06:40 PM

Tags for this Thread

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