-
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.
-
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.
-
<?>
try this:
txtcomments = txtcomments & rs.Fields!Comments & vbCrLf
-
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
-
<?>
About 1.6 times faster on 500 records
and 2.6 on 1000 records
Very nice to know..
Thank you.