Connecting Tech Pros Worldwide Forums | Help | Site Map

Jump to record in listbox

Geir Baardsen
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi!

I wasn't very clear, I think...

On frmItems I have a listbox, lstShowItems, that is being filled up
in the forms onload event with all records from tblItems.

Now when user navigate between records I did wish the cursor would
jump to the actual ItemID and select it in the lstShowItems.

I have searched the group, and I think this is impossible with the
present listbox component in ms access 2000?

Anybody that have a workaround of this?

Me.Name

Darryl Kerkeslager
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Jump to record in listbox


I can't think of any way to do this off the top of my head that doesn't
involve iterating through the list items to find out where the record is in
the list (at position i), then calling:

Me.lstShowItems.Value = Me.lstShowItems.ItemData(i)

Of course, I've never had a need to do that, since I use the listbox to
navigate between records, not the other way around.


Darryl Kerkeslager


"Geir Baardsen" <geir_baardsen@hotmail.com> wrote:[color=blue]
> On frmItems I have a listbox, lstShowItems, that is being filled up
> in the forms onload event with all records from tblItems.
>
> Now when user navigate between records I did wish the cursor would
> jump to the actual ItemID and select it in the lstShowItems.
>
> I have searched the group, and I think this is impossible with the
> present listbox component in ms access 2000?
>
> Anybody that have a workaround of this?
>
> Me.Name[/color]


Rolf Østvik
Guest
 
Posts: n/a
#3: Nov 13 '05

re: Jump to record in listbox


geir_baardsen@hotmail.com (Geir Baardsen) wrote in
news:35f9d8b7.0412130152.64d37dcc@posting.google.c om:
[color=blue]
> On frmItems I have a listbox, lstShowItems, that is being filled up
> in the forms onload event with all records from tblItems.
>
> Now when user navigate between records I did wish the cursor would
> jump to the actual ItemID and select it in the lstShowItems.
>
> I have searched the group, and I think this is impossible with the
> present listbox component in ms access 2000?
>
> Anybody that have a workaround of this?[/color]

Havent used Access so much lately but i have done somthing like this is
Access 97.

On the Forms OnCurrent event do something like:
lstShowItems.ItemId = Formname.ItemId

lstShowItems need to have a column named ItemID, You can hide it if you
want.

On your form you will need to have access to the ItemId corresponding to
the ItemId in the lstShowItems.

Hope this is what you want and that it works.

--
Rolf

Closed Thread


Similar Microsoft Access / VBA bytes