Solved

Getting the row number in an Access listbox

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Problem: You created a new custom form in Outlook for your contacts (added fields, deleted fields, changed the layout of fields, whatever) and made it the default form for contacts. The good news is that all new contacts will utilize the new form. T…
MS Access 2003 or later To MySQL Migration Project Hello All, this is my second article in the category of MS-OFFICE Automation. In internet I am not able to find any comprehensive resource on the Migration of MS Access back-end to MySQL so I fin…
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…

708 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

13 Experts available now in Live!

Get 1:1 Help Now