Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 1st, 2005, 09:26 AM
Friend of Wrox
Join Date: Jan 2005
Location: , , United Kingdom.
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Default Auto Select List Items

Hi Gurus!

I have a list box bound to a table. The list displays two columns. One column for a descriptive field and one for a boolean value. e.g.

S04 No
W04 Yes
S05 Yes
W05 No

On the forms load event I would like to auto select the items in the list box that have a Yes value. any Ideas???
Reply With Quote
  #2 (permalink)  
Old November 1st, 2005, 12:42 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

You need to set a button on the first form to open the second form, and then link the second form's record source to this list box. The wizard should do this for you automatically if you select open the form and display related data.

If not, you need to capture the bound values of the list box in variables, and then create a link criteria to your second form. I can do this with single values in combo boxes, but have not done this for n values from list boxes. I know I have seen a post on this recently.


Reply With Quote
  #3 (permalink)  
Old November 3rd, 2005, 01:12 PM
Authorized User
Join Date: Sep 2004
Location: Nanaimo, BC, Canada.
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts

I think it would be possible to do this in two other ways.

1. Focus on the list box, and see if there is a Select Method on the list box to select the ones you want. I think this should be possible. The Focus on the list box may not be necessary.

2. Focus on the list box, and use the SendKeys command.
Here's a bit of the manual in Access 2002.
Sends one or more keystrokes to the active window as if typed at the keyboard.


SendKeys string[, wait]


Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I list multiple items on 1 job? bamajog Access 3 April 19th, 2007 03:27 PM
Temporary storage for a items list leandro_tami ASP.NET 2.0 Basics 1 January 24th, 2007 07:56 PM
how to automate selecting all items from list satish_k Pro VB.NET 2002/2003 0 October 3rd, 2006 06:23 AM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 05:41 AM
Select Items in List from a String mwn1218 Access VBA 1 February 11th, 2005 11:21 AM

All times are GMT -4. The time now is 10:53 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.