Solved

ListBox Question

Posted on 1998-08-18
2
174 Views
Last Modified: 2010-04-30
I need to be able to read the value from a listbox that is only one line high.  I want the user to be able to click the up/down scroll bar (so it only shows one line of the listbox at a time), but not have to worry about actually clicking the item.  
The value must then be passed to another control to be written to a recordset.
What procedure or event do I use?  I have tried List1. Scroll but that doesn't seem to work.  As yet, I can only seem to get it to work once the user clicks the actual item.  This isn't suitable for my project.

Any ideas anyone???????????

Thanks...
   
0
Comment
Question by:nu2vb
[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
2 Comments
 
LVL 6

Accepted Solution

by:
anthonyc earned 20 total points
ID: 1429521
put a listbox (list1) on a form, and run this code:

Option Explicit

Private Sub Form_Load()
    List1.AddItem List1.ListCount
    List1.AddItem List1.ListCount
    List1.AddItem List1.ListCount
    List1.AddItem List1.ListCount
    List1.AddItem List1.ListCount
    List1.AddItem List1.ListCount
   
End Sub

Private Sub List1_Scroll()
    List1.ListIndex = List1.TopIndex
End Sub


it works
0
 

Author Comment

by:nu2vb
ID: 1429522
Thanks Anthony.  I tried and just used List1.Text to check my response - Absolutely perfect!

Now I can proceed to the next problem!

Thanks again.
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

688 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