If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
A question on auto growth textbox.
Hi all,
I had an algorithm which generate a pretty long string. An enlarged textbox which can contain a several lines of text was created. Now the string will be truncated into several pieces that is able to fit into the width of the textbox. However, Access 2007 truncate them like this: 100001/100023/14499 1/157621/ How could I make Access to truncate the string like this 100001/100023/ 144991/157621/ Thanks all. |
#2
|
|||
|
|||
A question on auto growth textbox.
In the after update event, count the characters, divide by 2 (or more), and
add a carriage return (vbCrLf) to each n characters in the string. The following code will count characters, excluding spaces. You will need to create a form level variable to replace [Text116] in the code, then use that variable in your division: Private Sub txtMyMemo_AfterUpdate() Dim lngIndex As Long Dim lngCharCount As Long For lngIndex = 1 To Len(Me.txtMyMemo) If Mid$(Me.txtMyMemo, lngIndex, 1) " " Then lngCharCount = lngCharCount + 1 End If Next lngIndex Me.Text116 = lngCharCount End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Aldred@office" aldred wrote in message ... Hi all, I had an algorithm which generate a pretty long string. An enlarged textbox which can contain a several lines of text was created. Now the string will be truncated into several pieces that is able to fit into the width of the textbox. However, Access 2007 truncate them like this: 100001/100023/14499 1/157621/ How could I make Access to truncate the string like this 100001/100023/ 144991/157621/ Thanks all. |
#3
|
|||
|
|||
¦^ÂÐ: A question on auto growth textbox.
Thanks Arvin, however, there is a problem that the font is having different
width in each character. For example i and m has different width for the given font so this solution might not work. "Arvin Meyer [MVP]" ¦b¶l¥ó ¤¤¼¶¼g... In the after update event, count the characters, divide by 2 (or more), and add a carriage return (vbCrLf) to each n characters in the string. The following code will count characters, excluding spaces. You will need to create a form level variable to replace [Text116] in the code, then use that variable in your division: Private Sub txtMyMemo_AfterUpdate() Dim lngIndex As Long Dim lngCharCount As Long For lngIndex = 1 To Len(Me.txtMyMemo) If Mid$(Me.txtMyMemo, lngIndex, 1) " " Then lngCharCount = lngCharCount + 1 End If Next lngIndex Me.Text116 = lngCharCount End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Aldred@office" aldred wrote in message ... Hi all, I had an algorithm which generate a pretty long string. An enlarged textbox which can contain a several lines of text was created. Now the string will be truncated into several pieces that is able to fit into the width of the textbox. However, Access 2007 truncate them like this: 100001/100023/14499 1/157621/ How could I make Access to truncate the string like this 100001/100023/ 144991/157621/ Thanks all. |
#4
|
|||
|
|||
A question on auto growth textbox.
Your only choice if that is a problem is to use Courier New or another fixed
width font. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Aldred@office" aldred wrote in message ... Thanks Arvin, however, there is a problem that the font is having different width in each character. For example i and m has different width for the given font so this solution might not work. "Arvin Meyer [MVP]" ¦b¶l¥ó ¤¤¼¶¼g... In the after update event, count the characters, divide by 2 (or more), and add a carriage return (vbCrLf) to each n characters in the string. The following code will count characters, excluding spaces. You will need to create a form level variable to replace [Text116] in the code, then use that variable in your division: Private Sub txtMyMemo_AfterUpdate() Dim lngIndex As Long Dim lngCharCount As Long For lngIndex = 1 To Len(Me.txtMyMemo) If Mid$(Me.txtMyMemo, lngIndex, 1) " " Then lngCharCount = lngCharCount + 1 End If Next lngIndex Me.Text116 = lngCharCount End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Aldred@office" aldred wrote in message ... Hi all, I had an algorithm which generate a pretty long string. An enlarged textbox which can contain a several lines of text was created. Now the string will be truncated into several pieces that is able to fit into the width of the textbox. However, Access 2007 truncate them like this: 100001/100023/14499 1/157621/ How could I make Access to truncate the string like this 100001/100023/ 144991/157621/ Thanks all. |
#5
|
|||
|
|||
¦^ÂÐ: A question on auto growth textbox.
If it is the only option, then I think I have to follow.
Thanks. "Arvin Meyer [MVP]" ¦b¶l¥ó ¤¤¼¶¼g... Your only choice if that is a problem is to use Courier New or another fixed width font. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Aldred@office" aldred wrote in message ... Thanks Arvin, however, there is a problem that the font is having different width in each character. For example i and m has different width for the given font so this solution might not work. "Arvin Meyer [MVP]" ¦b¶l¥ó ¤¤¼¶¼g... In the after update event, count the characters, divide by 2 (or more), and add a carriage return (vbCrLf) to each n characters in the string. The following code will count characters, excluding spaces. You will need to create a form level variable to replace [Text116] in the code, then use that variable in your division: Private Sub txtMyMemo_AfterUpdate() Dim lngIndex As Long Dim lngCharCount As Long For lngIndex = 1 To Len(Me.txtMyMemo) If Mid$(Me.txtMyMemo, lngIndex, 1) " " Then lngCharCount = lngCharCount + 1 End If Next lngIndex Me.Text116 = lngCharCount End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com "Aldred@office" aldred wrote in message ... Hi all, I had an algorithm which generate a pretty long string. An enlarged textbox which can contain a several lines of text was created. Now the string will be truncated into several pieces that is able to fit into the width of the textbox. However, Access 2007 truncate them like this: 100001/100023/14499 1/157621/ How could I make Access to truncate the string like this 100001/100023/ 144991/157621/ Thanks all. |
Thread Tools | |
Display Modes | |
|
|