Listbox items with Checkboxes

G

Guest

I have a listbox with rowsource as an SQL statement that retrieves values
from a lookup table, the items to be updated into another table on user
selection. I want to make this process easy for the user by including
checkboxes against the listbox items. The idea is, whatever items that the
user checks, will be updated to a field in a table on pressing OK button
after the user finishes his/her selection(multiple).

Looking forward for any help, will be greatly appreciated.
 
G

Guest

That's really a setback for me. Hope I find an alternative method that mimics
the functionality that I desire to obtain !

You guys have been great. Kindly pull me through this, please !!!
 
D

Douglas J Steele

One possibility (although a lot more work) would be to use the ListView
control that comes in mscomctl.ocx or comctl32.ocx.

It's more work because you cannot bind a data source to a ListView control:
you have to manually populate it. Randy Birch has an example at
http://vbnet.mvps.org/code/comctl/lvcheckbox.htm (although his description
doesn't match the form that's shown)

Obligatory warning: Randy's site is aimed at VB programmers. Because there
are significant differences between the controls available for forms in VB
and in Access, some of his samples do not port easily into Access. However,
this particular one should be fine.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Sreedhar said:
That's really a setback for me. Hope I find an alternative method that mimics
the functionality that I desire to obtain !

You guys have been great. Kindly pull me through this, please !!!
 
M

Marshall Barton

Sreedhar said:
I have a listbox with rowsource as an SQL statement that retrieves values
from a lookup table, the items to be updated into another table on user
selection. I want to make this process easy for the user by including
checkboxes against the listbox items. The idea is, whatever items that the
user checks, will be updated to a field in a table on pressing OK button
after the user finishes his/her selection(multiple).


You could do that if you use a continuous subform instead of
a list box.
 
G

Guest

I'm new to VBA and Doug's example seems to be too complicated for me to
adopt. Can you please elaborate on the Continuous Subform method ? I mean,
can you give me an AirCode that I can take a lead from ?

Many thanks.
 
M

Marshall Barton

Sreedhar said:
I'm new to VBA and Doug's example seems to be too complicated for me to
adopt. Can you please elaborate on the Continuous Subform method ? I mean,
can you give me an AirCode that I can take a lead from ?


The general idea is to create a continuous form that looks a
lot like a list box. Set its Record source to the whatever
you were using for the list box's rwo source.

At this point you have a couple of ways to deal with the
selecting a row. One way is to add a selected field to the
table. Then you use an Update query to clear the field when
you main form opens (or as needed). Since this would be a
bound field it is very easy to determine which entrys were
selected.

The othe way is to use Albert's clever use of a collection
instead of a field in the table. See the Multi Select
Example at
http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top