Results 1 to 7 of 7
  1. #1
    devcon is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    24

    Wrap text conditionally

    Good day,

    I would like your help.



    Use the following function to wrap the text on each keyword that is beginning in the 'comment' filed.
    The keywords are available in the table 'list'.

    Now I'd like to do the same thing not only if the keyword is at the beginning but anywhere (beginning, middle, end) in the 'comment' filed.
    Please note that there is the possibility that in the comment field can be more than one keyword, and for each key the text to be wrapped.

    Code:
    =IIf(DCount("[fWrap]","List","[fWrap] Like '*" & Left([Comment],2) & "*'"),[Description] & Chr(13) & Chr(10) & [Comment],[Description] & " " & [Comment])
    Thank you in advance.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Try Replace function:

    =Description & " " & Replace([Comment], [fWrap], [fWrap] & Chr(13) & Chr(10))
    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
    devcon is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    24
    Quote Originally Posted by June7 View Post
    Try Replace function:

    =Description & " " & Replace([Comment], [fWrap], [fWrap] & Chr(13) & Chr(10))
    Thank you for your reply, I'll try.
    Have a nice day.

    Devcon

  4. #4
    devcon is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    24
    Unfortunately no working.

    Devcon

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    My test works. Want to provide your db for analysis? Follow instructions at bottom of my post.
    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
    devcon is offline Novice
    Windows 7 Access 2007
    Join Date
    Jan 2010
    Posts
    24
    Thank you for your prompt reply.

    Company policy cannot permit me to email the db.

    Thank you again for your help.
    Devcon

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Not email, attach to post in thread.

    Don't care about data, just structure. Remove data.

    Otherwise, I can only wish you the best.
    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. Word Wrap in Access VB (MSAccess 2007)
    By rcrobman in forum Programming
    Replies: 4
    Last Post: 04-26-2011, 03:45 PM
  2. How to wrap text in a pivot table?
    By mcgill55 in forum Access
    Replies: 1
    Last Post: 04-13-2011, 10:28 AM
  3. Wrap line
    By devcon in forum Reports
    Replies: 1
    Last Post: 10-22-2010, 09:46 AM
  4. Can you wrap text in a Combo Box ?
    By softspoken in forum Forms
    Replies: 5
    Last Post: 03-21-2010, 05:32 AM
  5. wrap text
    By kamolrat in forum Reports
    Replies: 1
    Last Post: 11-17-2009, 01:36 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