scroll bar on text field

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
 
L

Linq Adams via AccessMonster.com

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
 
L

Linq Adams via AccessMonster.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top