Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Getting the row number in an Access listbox

Posted on 2012-03-18
1
Medium Priority
?
354 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 2000 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

618 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