Using Access 2000 SR1. Any idea why a text box in a sub form won’t wrap text. It has vertical scroll bars, but won
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Text box won’t word wrap
Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Text box won’t word wrap
- This topic has 22 replies, 7 voices, and was last updated 22 years, 2 months ago.
AuthorTopicWSPeter Kinross
AskWoody LoungerMay 3, 2001 at 5:19 am #355648Viewing 0 reply threadsAuthorReplies-
WScharlotte
AskWoody LoungerMay 3, 2001 at 5:37 am #524947Does it have more than one line of text in the field? If not, there isn’t anyplace to scroll to. If you’re doing this for editing purposes, it might be better to use the double-click event of the textbox control to zoom the field instead. Then you wouldn’t need scroll bars and the user could see the entire contents of the field at once. Just stick [indent]
RunCommand acCmdZoomBox
[/indent] into the DoubleClick event procedure.
-
WSPeter Kinross
AskWoody Lounger -
WSJerryC
AskWoody Lounger -
WSPeter Kinross
AskWoody Lounger -
WSGARYPSWANSON
AskWoody LoungerFebruary 20, 2003 at 6:01 pm #655112You said the text box if being fed via a data set as a memo field. In the subform, check the data feeding the form to ensure you are getting all of the characters. If you are generating the dataset for the form through a query, the text box data is probably being cut to 255 characters. To get all of the characters, take the final query for the form and join to the table with the memo field. Then pass the memo field data from the table.
HTH
-
-
-
-
WSRNCIENG
AskWoody Lounger -
WSPeter Kinross
AskWoody LoungerFebruary 21, 2003 at 11:23 am #655366 -
WBell
AskWoody_MVP -
WSPeter Kinross
AskWoody Lounger -
WScharlotte
AskWoody LoungerFebruary 24, 2003 at 3:07 am #655894 -
WSPeter Kinross
AskWoody LoungerFebruary 24, 2003 at 5:40 am #655924Yes, you can see the vertical scroll bars. Without my force warping code, the text just looks as if it extends beyond the edge of the text box, passing behind the scroll bars. The scroll bars just beep if you try to use them. Arrow keys do nothing. (because there is only 1 line?)
With my forced wrapping, the text box scroll bars work just fine. -
WScharlotte
AskWoody Lounger -
WSPeter Kinross
AskWoody Lounger -
WSGARYPSWANSON
AskWoody LoungerFebruary 25, 2003 at 1:09 pm #656486Peter,
With a little tweaking, you might be able to get the scroll bars to work.
In the database I am using, the height of the textbox is set to 0.2. The textbox shows the scroll bars but they don’t work as they should.
However, If I change the height to .2097, the scroll bars work properly. Even with the space limitations, perhaps a small increase in the height of the textbox will help.
HTH
-
WSPeter Kinross
AskWoody Lounger -
WSGARYPSWANSON
AskWoody Lounger -
WSPeter Kinross
AskWoody LoungerFebruary 27, 2003 at 9:32 am #657068Call the function as:-
NewNote = WrapText(Txt:=NewNote, MaxLgth:=45)Function WrapText(Txt As String, MaxLgth As Integer) As String
‘Called from
‘Forms_frmScratchNotes.Code Function EnterScratchNotes
‘Forms_frmTapesForPulling.Code Sub btnSendToExcel_Click
‘Txt As String, MaxLgth As Integer
‘Txt is passed string. MaxLgth is the maximum line lenght to be set.
‘Scratch Notes text box on main form show text if line is longer than is visible.
‘If scrolled, the next line is shown, not the text off the box on the previous line
‘format text to include Lf after Maxlgth chars
Dim Cntr As Integer, X As Integer, Posn As Integer
Dim L() As String, SpLine As String, ThisText As String, LastChar As String
On Error GoTo Err_WrapText
ReDim L(0 To 20)
‘Get rid of all Cr. (makes for easier parsing)
Txt = Replace(Txt, vbCr, “”)
‘Get rid of any blank lines, ie, more than 1 vbLf in a row
Posn = InStr(Txt, vbLf & vbLf)
Do
Txt = Replace(Txt, vbLf & vbLf, “”)
Posn = InStr(Txt, vbLf & vbLf)
Loop Until Posn = 0
‘Remove all the Lfs
Txt = Replace(Txt, vbLf, ” “)
Txt = Replace(Txt, ” “, ” “)
L(0) = Txt
‘Now parse so that line length Becomes = MaxLgth Then
SpLine = vbNullString
Posn = InStrRev(L(Cntr), ” “, MaxLgth)
If Posn = 0 Then ‘ie, no blanks. Split at MaxLgth
SpLine = Left(L(Cntr), MaxLgth)
L(Cntr) = Right(L(Cntr), Len(L(Cntr)) – MaxLgth)
Else ‘ie, there is a blank
SpLine = Left(L(Cntr), Posn)
L(Cntr) = Right(L(Cntr), Len(L(Cntr)) – Posn)
End If
‘Now move all rows down and make L(cntr)= SpLine
If Len(SpLine) > 0 Then
For X = 19 + 1 To Cntr + 1 Step -1
If X > 0 Then
If Len(L(X – 1)) > 0 Then
L(X) = L(X – 1)
End If
End If
Next X
L(Cntr) = SpLine
End If
End If
Next Cntr
ReDim Preserve L(0 To Cntr)
ThisText = Join(L(), vbCrLf)
LastChar = Right(ThisText, 1) ‘Remove linefeed @ end, if it’s there.
Do Until LastChar vbCrLf And LastChar vbCr And LastChar vbLf
Select Case LastChar
Case Is = vbCrLf, vbCr, vbLf
ThisText = Left(ThisText, Len(ThisText) – 1)
End Select
LastChar = Right(ThisText, 1)
Loop
WrapText = ThisText
Exit_WrapText:
Exit FunctionErr_WrapText:
gMsg = “We have an error in modMiscell” & vbCrLf & _
“procedure WrapText()” & vbCrLf & _
Err.Description & vbCrLf & _
“Write down this error message and call Peter”
MsgBox gMsg
Resume Exit_WrapText
Resume
End Function -
WSGARYPSWANSON
AskWoody LoungerFebruary 24, 2003 at 4:19 pm #656072Peter,
Ineterestingly enough, I just encountered this same problem. I had to reduce the height of a textbox on a form due to space limitations so only one line is displayed. Prior to the reduction, the text wrapped as it should.
However, if only one line is shown, the scroll up and down bars appear when the text exceeds the length of the textbox but you can only go to the end of the one line using the left right arrows or end button.
I just tested the same box and increased its height and the scroll bars work as they should.
I suppose that if only one line is being shown then there is nowhere to scroll down or up to.
-
WSPeter Kinross
AskWoody Lounger -
WSpatt
AskWoody LoungerFebruary 25, 2003 at 12:46 am #656335It’s a pleasure, look at post 228243
Pat
-
WSpatt
AskWoody Lounger -
WSPeter Kinross
AskWoody Lounger
-
-
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Where’s the cache today?
by
Up2you2
9 hours, 12 minutes ago -
Ascension says recent data breach affects over 430,000 patients
by
Nibbled To Death By Ducks
1 hour, 58 minutes ago -
Nintendo Switch 2 has a remote killing switch
by
Alex5723
3 hours, 43 minutes ago -
Blocking Search (on task bar) from going to web
by
HenryW
9 hours, 53 minutes ago -
Windows 10: Microsoft 365 Apps will be supported up to Oct. 10 2028
by
Alex5723
1 day, 2 hours ago -
Add or Remove “Ask Copilot” Context Menu in Windows 11 and 10
by
Alex5723
1 day, 2 hours ago -
regarding april update and may update
by
heybengbeng
1 day, 4 hours ago -
MS Passkey
by
pmruzicka
5 hours, 58 minutes ago -
Can’t make Opera my default browser
by
bmeacham
1 day, 11 hours ago -
*Some settings are managed by your organization
by
rlowe44
22 hours, 25 minutes ago -
Formatting of “Forward”ed e-mails
by
Scott Mills
1 day, 10 hours ago -
SmartSwitch PC Updates will only be supported through the MS Store Going Forward
by
PL1
2 days, 6 hours ago -
CISA warns of hackers targeting critical oil infrastructure
by
Nibbled To Death By Ducks
2 days, 15 hours ago -
AI slop
by
Susan Bradley
9 hours, 14 minutes ago -
Chrome : Using AI with Enhanced Protection mode
by
Alex5723
2 days, 16 hours ago -
Two blank icons
by
CR2
46 minutes ago -
Documents, Pictures, Desktop on OneDrive in Windows 11
by
ThePhoenix
2 hours, 44 minutes ago -
End of 10
by
Alex5723
3 days, 4 hours ago -
Single account cannot access printer’s automatic duplex functionality
by
Bruce
2 days, 2 hours ago -
test post
by
gtd12345
3 days, 10 hours ago -
Privacy and the Real ID
by
Susan Bradley
3 days ago -
MS-DEFCON 2: Deferring that upgrade
by
Susan Bradley
1 day, 2 hours ago -
Cant log on to oldergeeks.Com
by
WSJonharnew
3 days, 14 hours ago -
Upgrading from Win 10
by
WSjcgc50
2 days, 2 hours ago -
USB webcam / microphone missing after KB5050009 update
by
WSlloydkuhnle
2 days, 5 hours ago -
TeleMessage, a modified Signal clone used by US government has been hacked
by
Alex5723
4 days, 6 hours ago -
The story of Windows Longhorn
by
Cybertooth
3 days, 17 hours ago -
Red x next to folder on OneDrive iPadOS
by
dmt_3904
4 days, 8 hours ago -
Are manuals extinct?
by
Susan Bradley
1 day, 8 hours ago -
Canonical ditching Sudo for Rust Sudo -rs starting with Ubuntu
by
Alex5723
4 days, 17 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.