Results 1 to 8 of 8
  1. #1
    enemydr is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    4

    create default rich text in text box

    Hello, I want to create default value of a text box to be a word table that can be editable in form mode. I have a report that uses this form.


    I only managed to create the default value plaintext.

    If anybody can help me I ca send the database sample to see the problem more precisely.

    Thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    RTF actually uses HTML code tags. Type into the Default Value property, including the quote marks:

    "<b>This is default value.</b>"

    Don't really understand what you mean by "to be a word table".
    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
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Two issues:

    1. getting data from Word document

    2. formatting it as RTF

    Get number one solved and number two should be easy. The content of the textbox won't be a table. It could be a multi-line string of text, however, the apparent indentation achieved in a table with columns will be lost.

    I did a copy/paste of the table into the textbox as a test and the BOLD formatting was retained. However, pasting into the DefaultValue property lost the BOLD formatting.

    This is also an MDB database. I think RTF is different with MDB than with ACCDB files.
    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.

  4. #4
    enemydr is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    4
    MMF.zip

    I've attached my file above. What I need to do is to put in "Epicriza" textbox from PacientFisa form the default text as rich text because I want to appear in the report "a" as separate lines. Thank you.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Yes, RTF allows the copy/paste Word table to retain multi-line but that won't help with typed data entry. RTF doesn't automatically produce multi-line string and RTF isn't needed to do that anyway. RTF or otherwise, set the EnterKeyBehavior property of textbox to New Line.

    Copy/paste of the Word table into DefaultValue property won't retain the formatting. Can type the HTML into DefaultValue property:

    "This is a test of <b>BOLD</b><br>and multi-line Default Value."
    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
    enemydr is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    4
    Thank you very much, your indications solved my problem.
    One more question. In the box "numar registru" that has control source "Caz_ID" can I set as default number the following number in the table (the previous recorded data +1)?

    And after I made the changes when I click "tiparire" my report is not showing any more, any idea why?

    My modified file is here MMF-modified.zip

    Thank you

  7. #7
    enemydr is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2014
    Posts
    4
    anybody can help?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    One way is to set the DefaultValue property with VBA. http://access.mvps.org/access/forms/frm0012.htm

    I can't find box "numar registru".

    Should be acViewPreview not acPreview.

    The report is saved with criteria in the Filter property. Remove it and set FilterOnLoad to No.

    Report still wouldn't work. I created a new report and copy/pasted everything from the old one. Renamed them. New report works. Corruption happens.
    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. Using <br> Tag in Rich Text Box
    By Gina in forum Programming
    Replies: 9
    Last Post: 01-28-2014, 11:56 AM
  2. Rich text - text color and size
    By Subs in forum Reports
    Replies: 3
    Last Post: 11-08-2013, 10:36 AM
  3. Rich text default settings
    By Sanyusha in forum Forms
    Replies: 2
    Last Post: 06-12-2013, 02:28 AM
  4. Replies: 1
    Last Post: 05-24-2012, 04:59 AM
  5. Set format of rich text field
    By silverspr in forum Programming
    Replies: 0
    Last Post: 03-28-2011, 09:07 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