Moxie Drive Expressions Article Directory


Access Database Tip: How to multiselect in a Listbox...

Access Database Tip: How do I multi select in a List box?

When you have a list box it is hand to be able to multiselet to perform some action on multiple items in the list box. Here is a simple set of instructions to get you started. These instructions will create a quick way to multiselect and delete rows from a table.

Follow these steps:

1]create a simple form

2]add two text boxes named SelCt and LstCt

3]add a list box named List0

4]on the list box properties form tab "Other" set the Multi Select to Extended

5]on the "Data" tab set
Rowsource type to Table/query
row source to SELECT tmpIndextbl.sFileName FROM tmpIndextbl ORDER BY tmpIndextbl.sFileName;

6]put this code between the *****on the "Event" tab "After update" event

**********
Private Sub List0_AfterUpdate()
Dim ctl As Control, X As Integer, selItem As Variant, sql As String

Set ctl = List0
For Each selItem In ctl.ItemsSelected
X = X + 1
Debug.Print ctl.ItemData(selItem)
sql = "DELETE tmpIndextbl.sFileName FROM tmpIndextbl"
sql = sql & " WHERE (((tmpIndextbl.sFileName)='" & ctl.ItemData(selItem) & "'));"
DoCmd.RunSQL (sql)

Next selItem
SelCt = X
List0.Requery

**********

Save the form

7]Create a table with data for this example named "Tmpindextbl. " Make sure you have at least one field named sFileName.
You will need to add some dummy data for testing.

You can download the example and the demo mdb that accompanies this tip at. Getting the example there will save you a little work. The demo database also has a counter to show you how many entries have been selected.
http://www.biomationsystems.com/AccessTips.htm

BioMation Systems, Inc provides process improvement services that include solutions used by both large and small companies that are affordable and easy to use. Our products and services are proven to enable our customers to provide better service to their customers while saving them money in the process. Our customers find that their return on investment is most often realized after using their applications just a few times.

What could BioMation Systems do for you?

Go ahead, take a look.



Category: Software

Access Database Tip: How to multiselect in a Listbox was written by:

Author:Jon Watson
Added: Sat, 20 Oct 2007 07:40:24 -0400
This Article Has Been Read 376 times

View all Jon Watson's articles

About the Author: Jon Watson is the founder of Biomation Systems, Inc. With 26 years experience helping Fortune 500 companies with process improvement he formed BioMation to bring the same expertise to smaller companies that need the same improvements at an affordable price.
Website: http://www.biomationsystems.com

More Articles About Software

Popular Articles

Access DatabaseTip: Create a user defined search field for a list box
Guidelines to Making a Successful Presentation
MS Access Quick Cash Flow Calculator tip
MS Access Tip: Keeping up with user Activity
The best open source scripts on php/mysql
Working from the beach: remote office in a nutshell
Most Popular Electronic Medical Billing Software
Internet explorer vs. FireFox
How to Bypass Websense
Software for Tax Deduction
What Is The Purpose Of ERP Software?
Erasing your Internet Tracks and History
The Most Important Components of HR Software
Software Testing Course: Where Can You Take Them?
Internet Cleaners Tools
Looking For Erp Software?
The Latest News On ERP Software
Quickbooks Premier: A Notch Above the Rest
Anti-Spyware and Pro Security
Digital Rights Management And It's Death
Recent Articles

Stunning Powerpoint Presentation 2 Powerful Secrets Revealed
Three Ways to Become an Expert on Presentation
Download Most Popular Software titles online instantly
Microsoft Excel Basics: What Are Functions?
How to Bypass Websense
Softweb Solutions - Global offshore IT solution provider
How Point of sale software will automate your online business
Software Outsourcing
Privacy on the Internet
Web Filtering in the Business Place
Providing for your customer with CRM
The revolutionary software - Astute
STOCK TRADING SOFTWARE PROGRAMS
Information regarding Web Filtering
What is Astute Software?
The Benefits of Web Filtering
Training Staff on New Business Software
Hot Facts About Tax Software No One Else Will Tell You About.
Today's Dashboard - Not just something in your car!
Crystal Reports XI

Not What You Were Looking For?


Google
Google

Moxie Drive Expressions Article Directory Main Page. Moxie Drive Expressions

Submit Articles Submit Articles

Contact us Contact us

Add to favorites Add us to favorites


Add to Mixx!

Fave it!

Subbmitt!

Hint - Hold "T" button down and right click to open Sphinn and Subbmitt in a new window.



Count



Feeds

Valid HTML 4.01 Transitional