Wrox Programmer Forums
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 1st, 2005, 09:26 AM
Friend of Wrox
Join Date: Jan 2005
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???
Old November 1st, 2005, 12:42 PM
Friend of Wrox
Join Date: Mar 2004
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.


Old November 3rd, 2005, 01:12 PM
Authorized User
Join Date: Sep 2004
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]


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

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.