Results 1 to 5 of 5

Thread: Multiline Text box / Button (key board Event)

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Location
    Posts
    14

    Red face

    hi Friends
    i am trying to dispaly records in Multiline Text
    box.

    like this
    do while not rs.eof
    txtcomments = rs.fields("comments")
    or txtcomments = txtcomments & rs.fields("comments")
    rs.movenext
    loop

    after displaying/adding 1st record and i want to display 2nd recond in next line and 3rd in 3rd line etc.,
    i.e., i want to add/display each and every record in separate/new line in Text Box.

    how it's possible. please help me.


    how to execute/click event through programatically.

    Through programatically i want to press/click Enter/Return Key.

    Thanks in Advance.




  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    461
    Code:
    do while not rs.eof 
      txtcomments = txtcomments & rs.fields("comments") & vbcr
      rs.movenext 
    loop
    You need the Carriage Return on the end of each line so that the new one is on the next line.

  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    try this:

    txtcomments = txtcomments & rs.Fields!Comments & vbCrLf


    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    Concatenating the text property with some more text and assign it back to the text property is a very slow action. This code runs more then twice as fast:
    Code:
    Do While Not rs.EOF
        txtComments.SelStart = Len(txtComments)
        txtComments.SelText = rs!Comments & vbCrLf
    Loop

  5. #5
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    About 1.6 times faster on 500 records
    and 2.6 on 1000 records


    Very nice to know..
    Thank you.
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

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



Click Here to Expand Forum to Full Width