List box question

J

JMorrell

I have a list box on a form that a user uses to read information. The size
of the list box is small and not all the text is visible at any one time.
For elegance reasons, I would like the list box to automatically scroll down
when that particular record comes up. The user can click inside the list box
and then grab the scroll bar handles. But I'd rather not have them do that.

Is there a way to have the list box scroll down automatically?

tia,
 
L

Larry Linson

I am not at all certain what you mean by "like the list box to automatically
scroll down when that particular record comes up"? Please clarify.

A Combo Box, by default, will scroll to the "nearest match" as you type into
it.

Larry Linson
Microsoft Access MVP
 
R

Randy Balbuena

JMorrell said:
I have a list box on a form that a user uses to read information. The size
of the list box is small and not all the text is visible at any one time.
For elegance reasons, I would like the list box to automatically scroll
down
when that particular record comes up. The user can click inside the list
box
and then grab the scroll bar handles. But I'd rather not have them do
that.

Is there a way to have the list box scroll down automatically?

tia,

JMorrel,

Do you mean highlighting or moving the current item selection in a list box?
If that is the case use the following code:

MyList.Selected(MyItemIndex) = True

Does that help?
 
J

JMorrell

Sorry for the confusion... it's not a Combo Box after all. It's actually a
small to large text box with scroll bars when it has focus.

By automatically scrolling, I mean having the text scroll through without
the user having to 1) grab the scroll bar handle and drag it down, or 2) put
a cursor in the box and hit the down arrow. Maybe "animated" would be a word
to use.

ta,
JMorrell
 
R

Randy Balbuena

JMorrell said:
Sorry for the confusion... it's not a Combo Box after all. It's actually
a
small to large text box with scroll bars when it has focus.

By automatically scrolling, I mean having the text scroll through without
the user having to 1) grab the scroll bar handle and drag it down, or 2)
put
a cursor in the box and hit the down arrow. Maybe "animated" would be a
word
to use.

ta,
JMorrell

JMorrel, thanks for clarifying. To force the textbox to scroll down
automatically, you could use the following code:

Me.MyTextBox.SetFocus
Me.MyTextBox.SelStart = Len(MyTextBox)

Does that help?
 
J

JMorrell

Thanks for the reply. It works like it was designed, but not the way I
intended. In my code, it jumps to the bottom of my text box instead of a
slow scroll. The effect I was after was to have the text box scrolling so
that the user (i.e. reader) could read the text as it scrolled (think
teleprompter).

If it can't be done with VB through Access, then that's the way it is. I'm
always looking for more bells and whistles than I need anyhow. No big deal.

Thanks again for your help. I'm sure I can use this nugget later on
somewhere, sometime.

JMorrell
 
Top