473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to move to item in ListBox?

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.
Nov 13 '05 #1
2 3826
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
Nov 13 '05 #2
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/AwUBQw9lt4echKqOuFEgEQKEaACgto1o0p7u8+dW10O1rG44KX yDna8AoM9g
rT8PLG8hL1SuzCrrtZIHsITZ
=Ri+J
-----END PGP SIGNATURE-----
Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name...
7
by: Byron | last post by:
I'm looking for a way to deny a move from the current listbox item. For instance, if the user is editing the record associated with the current listbox item I want to deny a move within the...
1
by: kent | last post by:
Hi All, On my form, I have 2 listboxes that get populated with the correct items. I have 4 buttons between the 2 boxes. The first 2 buttons are used to move the selected item back and forth...
5
by: Joe Fallon | last post by:
I have a list box with 7 text values in it. I have a pair of buttons to Move Up or Move Down the selected item one position. What is the simplest way to code the buttons so the item moves one...
2
by: K B | last post by:
Hi, The following code has been successful for me in the past and i just can't figure out where I'm going wrong. When I debug I keep getting the two top items as selected even though there are not...
6
patjones
by: patjones | last post by:
Sometimes you might have two list boxes side by side, and want to double-click on an item in one box to move it to the other. For instance, maybe the first list box contains a list of customers,...
2
by: erbear | last post by:
Hi all, I am new to VB, and I am having some troubles. I have a listbox that when you click on the item it displays a picture in a picture box and a message in a label. It works fine when an item...
2
by: vinod allapu | last post by:
hi all, i am trying to generate a report, iam using sql server 2000 and Asp.net 2.0. First to select the columns iam using the list box... as we can order by the query result from the...
5
by: amandab116 | last post by:
I'm having a hard time figuring out how to move items between a left and right listbox server-side. I have a populated listbox from the database on the left and I'm trying to add items to the box...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.