Multiline textboxes

  • Thread starter Thread starter Shadow
  • Start date Start date
S

Shadow

Any kind of help is much appreciated.

How can I retrieve the values typed by a user in a multiline textbox?

The users of a form type several values in a multiline textbox ( hitting
Enter key on the keyboard after each value). Now in a vba function I need to
know which value is typed in the first line , what is typed in second line ,
........

For example, a user types 111 in the first line of the multiline textbox and
222 in the second line and 333 in the third line. Now I need to know what
the second of the second line of this textbox is typed.

Thanks for any kind of advice
 
Shadow said:
Any kind of help is much appreciated.

How can I retrieve the values typed by a user in a multiline textbox?

The users of a form type several values in a multiline textbox (
hitting Enter key on the keyboard after each value). Now in a vba
function I need to know which value is typed in the first line , what
is typed in second line , .......

For example, a user types 111 in the first line of the multiline
textbox and 222 in the second line and 333 in the third line. Now I
need to know what the second of the second line of this textbox is
typed.

Thanks for any kind of advice

The values in the text box will be separated by
carriage-return/line-feed combinations. Assuming you're using Access
2000 or later, you can use the Split function to split the contents into
an array, using that pair of characters as a delimiter. E.g,

Dim astrLines() As String
Dim I As Integer

astrLines = Split(Me.MyTextbox, vbCrLf)

For I = LBound(astrLines) To UBound(astrLines)
Debug.Print "Line " & I & ":", astrLines(I)
Next I
 
Million thanks for the details.





Dirk Goldgar said:
The values in the text box will be separated by
carriage-return/line-feed combinations. Assuming you're using Access
2000 or later, you can use the Split function to split the contents into
an array, using that pair of characters as a delimiter. E.g,

Dim astrLines() As String
Dim I As Integer

astrLines = Split(Me.MyTextbox, vbCrLf)

For I = LBound(astrLines) To UBound(astrLines)
Debug.Print "Line " & I & ":", astrLines(I)
Next I


--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 
Back
Top