Solved

Getting the row number in an Access listbox

Posted on 2012-03-18
1
303 Views
Last Modified: 2012-03-31
Hi All -

I have an unbound listbox and I nered a way to identify the row number that the user just selected.

I then want to take that number and advance the cursor to the next row when a button is pushed and make the Listbox highlight the next item and then fetch the underlying data.

Lenny
0
Comment
Question by:LennyGray
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 500 total points
ID: 37736367
To get the selected item use the .ItemsSelected propery. See: http://msdn.microsoft.com/en-us/library/aa196172%28office.11%29.aspx

Also check out the ItemData Property at http://msdn.microsoft.com/en-us/library/aa196159%28office.11%29.aspx


To select an item use:

if X = current selected item then use this to select the next row

If X < Me.ListBox.ListCount 
   Me.ListBox.Selected(X + 1) = True
End If

Open in new window

0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question