+ Reply to Thread
Results 1 to 3 of 3

Inserting String into Rich Textbox on form open

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Sheffield
    MS-Off Ver
    2007
    Posts
    32

    Inserting String into Rich Textbox 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? One 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
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Inserting String into Rich Textbox on form open

    Are you doing this in Excel (the forum you're in) or Access (where DoCmd lives)?

    If in Excel, where did you get the RichTextBox control? It was discontinued in Excel 2003.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    02-06-2013
    Location
    Sheffield
    MS-Off Ver
    2007
    Posts
    32
    Quote Originally Posted by shg View Post
    Are you doing this in Excel (the forum you're in) or Access (where DoCmd lives)?

    If in Excel, where did you get the RichTextBox control? It was discontinued in Excel 2003.
    Damn, sorry, posted in wrong place.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replace text string in a cell and retain rich text formatting (Excel 2013)
    By CharlieBear in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-15-2015, 04:39 PM
  2. Replies: 3
    Last Post: 05-07-2012, 09:46 PM
  3. [SOLVED] Rich TextBox Control on UserForm
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-12-2011, 11:51 AM
  4. [SOLVED] Rich Textbox Control
    By Chris in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-10-2006, 09:25 PM
  5. [SOLVED] Rich Textbox
    By M.Siler in forum Excel General
    Replies: 8
    Last Post: 05-05-2005, 03:06 PM
  6. Rich Textbox
    By M.Siler in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-05-2005, 03:06 PM
  7. Load text to textbox on form open
    By [nordis] in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-12-2005, 12:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1