A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

A question on auto growth textbox.



 
 
Thread Tools Display Modes
  #1  
Old February 2nd, 2010, 06:37 AM posted to microsoft.public.access.forms
Aldred@office
external usenet poster
 
Posts: 28
Default 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  
Old February 2nd, 2010, 01:51 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default 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  
Old February 4th, 2010, 06:52 AM posted to microsoft.public.access.forms
Aldred@office
external usenet poster
 
Posts: 28
Default ¦^ÂÐ: 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  
Old February 4th, 2010, 03:24 PM posted to microsoft.public.access.forms
Arvin Meyer [MVP][_2_]
external usenet poster
 
Posts: 2,310
Default 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  
Old February 5th, 2010, 08:00 AM posted to microsoft.public.access.forms
Aldred@office
external usenet poster
 
Posts: 28
Default ¦^ÂÐ: 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:43 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.