Results 1 to 8 of 8

Thread: Excel MultiLine Textbox to Access Database - MultiLine lost in the Access Database

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Excel MultiLine Textbox to Access Database - MultiLine lost in the Access Database

    I have a Multiline textbox inside an Excel Userform. I enter in multiple lines of text:
    excel_to_access_1.jpg

    And then update the Access database. I no longer see text in access with multiplelines:
    excel_to_access_2.PNG

    I'm using the following code to update the database:
    cmdCommand.ActiveConnection = conn
    strSQLCommand = "UPDATE testTable SET testTable.stuffField = """ + comment + """ WHERE (((testTable.numberField)=""" + numberField + """) AND ((testTable.Book)=""" + book + """));"
    cmdCommand.CommandText = strSQLCommand
    cmdCommand.CommandType = 1
    Set recSet = cmdCommand.Execute
    
    
    conn.Close
    Set conn = Nothing
    When I look at the text from the Access Database I don't see carriage returns CR or LF(I copied the text into Notepad++). However, when I retrieve data from the access database and view it back in excel I do see that the text is multilined... (If I edit the text directly in access I can add multiple lines and do see the carriage returns)

    The evidence leads me to believe that excel doesn't use standard carriage returns to display text in a textbox.

    I have two questions:
    1) Do you know if there is a difference in how Access stores newlines vs an Excel Textbox?
    2) Do you see a way to adjust my code to send carriage returns to the Access Database? - BTW: I have tried adding Chr(10), Chr(13), and vbNewLine to the comment string and it didn't work.

    Thanks,
    -Don
    Attached Images Attached Images

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
  •