Home > Archive > MS Access database support > August 2005 > How to move to item in ListBox?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author How to move to item in ListBox?
deko

2005-08-26, 3:24 am

If I know the index of an item in a ListBox, how do I "move" the list or "go
to the item" so that item is highlighted and displayed in the list box?

Is there some way to do something like this:

DoCmd.Goto Me!lstEntity.ItemData(i) 'pseudo code

Thanks in advance.


(PeteCresswell)

2005-08-26, 3:24 am

Per deko:

>If I know the index of an item in a ListBox, how do I "move" the list or "go
>to the item" so that item is highlighted and displayed in the list box?
>
>Is there some way to do something like this:


Is the list bound to a PK?

If so, if you set the list's value to the PK of the record you want to "go to",
it will select that record.

e.g.

Me.lstFundNames = 1000312
--
PeteCresswell
MGFoster

2005-08-26, 8:24 pm

deko wrote:
> If I know the index of an item in a ListBox, how do I "move" the list or "go
> to the item" so that item is highlighted and displayed in the list box?
>
> Is there some way to do something like this:
>
> DoCmd.Goto Me!lstEntity.ItemData(i) 'pseudo code


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Try this:

Me!lstEntity.Selected(i) = True

i is a zero-based index. To select the first item in the List Box use
0. To select the 4th item in the List Box use 3.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/ AwUBQw9lt4echKqOuFEg
EQKEaACgto1o0p7u8+dW
10O1rG44KXyDna8AoM9g

rT8PLG8hL1SuzCrrtZIH
sITZ
=Ri+J
-----END PGP SIGNATURE-----
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com