Solved

Getting the row number in an Access listbox

Posted on 2012-03-18
1
238 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
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now