scroll bar on text field

  • Thread starter Thread starter Penstar
  • Start date Start date
P

Penstar

I have a vertical scroll bar on a text field. This is fine and I want it
there when there is alot of text in the field. However, I dont want it there
when there are only a couple of words in the field.

Is there any way to get the scroll bar to show only when it is needed?

Thanks
Penny
 
Decide how many characters you want in the textbox before you need the
scrollbar to appear, then use this code, replacing the 20 with the number of
characters you want:

Private Sub Form_Current()
If Len(Me.YourTextBox) > 20 Then
YourTextBox.ScrollBars = 2
Else
YourTextBox.ScrollBars = 0
End If
End Sub
 
Glad I could help!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
 
Back
Top