Group:  Microsoft Access ยป microsoft.public.access.formscoding
Thread: Scroll to first item in list box in ACC2K3?

Geek News

Scroll to first item in list box in ACC2K3?
"Tony" <|toxendine[ at ]hoopercorp.com|> 11/21/2008 7:42:43 PM
I've got a form with a list box that has ~ 100 items. When the user selects
a radio button, the list is enabled and they can select multiple items.
When the user clicks another radio button, I clear all of their selections,
but also want the list box to jump to the top of the list.

Any ideas?

Thanks


Re: Scroll to first item in list box in ACC2K3?
fredg <fgutkind[ at ]example.invalid> 11/21/2008 9:53:46 PM
On Fri, 21 Nov 2008 13:42:43 -0600, Tony wrote:

[Quoted Text]
> I've got a form with a list box that has ~ 100 items. When the user selects
> a radio button, the list is enabled and they can select multiple items.
> When the user clicks another radio button, I clear all of their selections,
> but also want the list box to jump to the top of the list.
>
> Any ideas?
>
> Thanks

Dim varItem As Variant
For Each varItem In ListBox.ItemsSelected
ListBox.Selected(varItem) = False
Next varItem
Me.ListBox.Selected(0) = True
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Re: Scroll to first item in list box in ACC2K3?
"Tony" <|toxendine[ at ]hoopercorp.com|> 11/24/2008 3:59:33 PM
Hey fredg,

Thanks for the response. Tried this already but it didn't produce the
results I'm looking for. It selects, but does not scroll to, the first
item. What I'm hoping to accomplish is to reset the listbox such that if
the user changes their mind again and wants to select an item(s) in the
list, they are able to start at the top without scrolling up. I want to do
the scrolling part for them. I realize that it's easy for the user to do
this, but want to limit clicks whenever possible.

Any other suggestions? Thanks.


"fredg" <fgutkind[ at ]example.invalid> wrote in message
news:eetnlrseaqyd.f9zn2hz1h52d.dlg[ at ]40tude.net...
[Quoted Text]
> On Fri, 21 Nov 2008 13:42:43 -0600, Tony wrote:
>
>> I've got a form with a list box that has ~ 100 items. When the user
>> selects
>> a radio button, the list is enabled and they can select multiple items.
>> When the user clicks another radio button, I clear all of their
>> selections,
>> but also want the list box to jump to the top of the list.
>>
>> Any ideas?
>>
>> Thanks
>
> Dim varItem As Variant
> For Each varItem In ListBox.ItemsSelected
> ListBox.Selected(varItem) = False
> Next varItem
> Me.ListBox.Selected(0) = True
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net