Checkboxes within a listbox

C

Cliff_G

I recently saw an Access app with a form containing a multi-select listbox
that the user could select rows and send data to a report/printer.

The coolness factor was that each row had a checkbox in front of the item.
The user could scroll through the list checking all items they wanted to send
to a report. I can build a multiselect that creates a query to send to a
report. I just really liked the way the checkboxes looked. Anybody know how
to do such a thing?

I know...there is no value over the ordinary multiselect method except the
way it looks. Curiousity is killing me. Thanks,
 
S

Steve Schapel

Cliff,

I would suspect that what you saw was not a listbox. Sounds a lot more
like a subform to me. You can use a continuous view subform, with a
Yes/No field in its record source for the purpose of selecting the
records via a checkbox.
 
C

Cliff_G

Steve, thanks for the reply. Could anybody point me in a direction to see
some examples/sites that could further explain how I could use a continuous
view sub-form to mimic a multi-select listbox?

Do I have to put the yes/no field in the table used by the subform
recordsource or do I write SQL that creates a field?

Thanks again Steve!
 
S

Steve Schapel

Cliff,

Yes, you would put a Yes/No field into the table that the subform uses
as its record source.

If you want it to look like a Listbox, you will need to adjust some of
the properties. For example...
Record Selectors = No
Navigation Buttons = No
Dividing Lines = No
Back Color of the Detail section to white
Back Color of any textboxes to transparent
etc...

One way to simulate the highlighting of the selected rows would be to
make a textbox bound to the same Yes/No field as the checkbox, size it
so it occupies the entire Detail section of the form, set its Enabled
property to No and its Locked property to Yes, and then use Conditional
Formatting (under the Format menu) to adjust the Back Color and Fore
Color according to the field value being 0 or -1.

Not a totally complete answer... after all, I have never actually done
this! But hopefully this will point you in the right direction.
 
Top