Microsoft Access 2007 with VBA - Parse Textbox, vbCrLf delimited
Through some cruel twist of fate I have landed a job maintaining a system built entirely on Microsoft Access 2007.
Anyway, I have a TextBox on a Form. I wan开发者_运维技巧t to parse the contents of this TextBox. I want to declare two strings, have string one equal to the first line of the TextBox, string two equal to the second line and so on.
I think I need to something similiar to below but I can't quite get my head around it.
Thanks
John
Dim stringOne As String
Dim stringTwo As String
Dim contentsOfTextBox As Array
contentsOfTextBox = Split("txtMyTextBox.Text", "vbCrLf")
stringOne = contentsOfTextBox[0].Text
stringTwo = contentsOfTextBox[1].Text
I think you mean
contentsOfTextBox = Split(Me.txtMyTextBox, vbCrLf)
stringOne = contentsOfTextBox(0)
stringTwo = contentsOfTextBox(1)
However, this looks like it may be leading to an awkward idea. It may be best to describe the real world problem you wish to solve with this.
精彩评论