473,385 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Select an item in a list box through vba

convexcube
Hi everyone,

I have done some searches and come up with no definitive answer. Is it possible to select a specific item in a list box with vba code in Access 2007

Thanks in advance for your help,
Ken.
Feb 7 '08 #1
3 62420
I've discovered the answer:

Expand|Select|Wrap|Line Numbers
  1. lstListBox.Selected(Form_Records.lstListBox.ListCount - 1) = True
Kind Regards,
Ken Farrawell.
Feb 7 '08 #2
I've discovered the answer:

Expand|Select|Wrap|Line Numbers
  1. lstListBox.Selected(lstListBox.ListCount - 1) = True
Kind Regards,
Ken Farrawell.
Well at least that will select the last item in the list box, which in my case was the last added item and the one I wanted to select.
Feb 7 '08 #3
NeoPa
32,556 Expert Mod 16PB
If you know the value of the line you want to select then I would suggest trying :
Expand|Select|Wrap|Line Numbers
  1. lstListBox = {value}
Not very sexy, I know, but works in earlier versions anyway.
Feb 7 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Eric Freeman | last post by:
Is there any way in Postgres to SELECT a list of table names from inside of a C program using ECPG? Something similar to SELECT current_user that will give you all of the tables in the database...
5
by: mabond | last post by:
Hi My project has a form, two list boxes (lstArchive and lstSchedule) and two buttons (btnSendArchive and btnSendSchedule) Each list box represents the content of a directory. The command...
4
by: VK | last post by:
I'm looking for autoexpand <select> list onfocus and collapse it back onselect/onblur (the list is select-one type) I know it is not possible directly, but I've seen here a hack by changing...
3
by: Prashant Mahajan | last post by:
Hi All, I am facing a problem regarding accessing the item list of an XML node in IE. While using the following code: for(test in XMLNode) {} I received this XML Node from AJAX's...
3
by: Beholder | last post by:
I hope that someone can help me with the following: Short background explenation: I have a shrfepoint page (newform.aspx) in a item list. On this page is a lookup column that displays a lookup...
5
by: =?Utf-8?B?bWNhdWxpZmZl?= | last post by:
I have an old application ( pre-VB5) that I need to add a select/option list to. This is an edit program so the values for the form will be retrieved from a database. How do I set the value of...
0
by: Andrus | last post by:
How to create select columns list dynamically in DLinq ? I want to create something like Console.WriteLine("Enter list of columns to return, separated by commas:"); string list =...
17
vikas251074
by: vikas251074 | last post by:
I have create form as below - <table> <tr> <td align="right">VLAN Name : </td> <td> <select name="vlan_name" style="width:150px "> <% ...
1
by: gayat jain | last post by:
jsf <h:select item> how i can call bean method one click any select item
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.