Results 1 to 3 of 3
  1. #1
    mdex is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    11

    Autopopulate RichTextBox on form open

    I'm trying to prepopulate certain fields on a form when opening using a button.



    I have it working for single line entries but I have a rich textbox which I would like different info on different line.

    I've tried both Chr(13) & Chr(10) and VbCrLf but all the text is still on the one line. From what I've read this is because it's a rich text box? Once the form is opened I can manually go to a new line with the ENTER key as that is set in properties.

    Any help greatly appreciated. Below is just one of the ways I've tried that only puts the info on 1 line.

    ------------

    Dim D As String

    D = "SITE NAME:" & vbCrLf & "ON-SITE CONTACT:"

    DoCmd.OpenForm "Case Details", acNormal, , , acFormAdd
    Forms![Case Details]![Description] = D

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I think programmatically filling RTF field requires HTML code tags. https://social.msdn.microsoft.com/Fo...orum=accessdev
    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
    mdex is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    11
    Quote Originally Posted by June7 View Post
    I think programmatically filling RTF field requires HTML code tags. https://social.msdn.microsoft.com/Fo...orum=accessdev
    Brilliant thanks. Was scratching my head all afternoon with that one.

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

Similar Threads

  1. Replies: 8
    Last Post: 10-03-2014, 01:34 PM
  2. Replies: 4
    Last Post: 01-16-2013, 12:33 PM
  3. Autopopulate names from table onto form and more
    By Kat-ness in forum Database Design
    Replies: 17
    Last Post: 12-15-2012, 08:28 AM
  4. Replies: 7
    Last Post: 10-03-2012, 03:06 PM
  5. Replies: 3
    Last Post: 05-26-2011, 12:52 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