Use a list box to store multiple values in a field

N

Nick

I know that you can use a list boxs' selection to be stored in a field on the
same form and I know how to do that. The problem is that when I change the
list box to allow multiple selections the selections are no longer put into
the desired field. Is there something I can do to fix the problem? Thanks.
 
J

Jeff Boyce

Nick

One of the basic principals of good database design is 'one fact, one
field'. When you have a single listbox item selected, you have a single
fact.

Trying to store multiple facts (multi-select listbox) in a single field
would create all kinds of headaches for determining which one-of-many is
applicable.

Oh wait, you were talking about forms, which have controls, where it's the
tables that have fields.

If you already have the selections made in the listbox, why do you feel you
need to duplicate those selections in another control?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
N

Nick

Jeff-
Thanks for the respone. I'll try to explain myself a little better. The list
box contains a set of "business rules" for reporting. For each user, and the
report they are doing, there are multiple business rules but everyone uses
the same business rules. So, I want a list box (probably has 20 "rules") so
the user can just go in and for example, click on the 10 business rules that
they use for their report and the rules will show up in a field on the form
so they can see all of them at once. Thanks again for the help, hopefully I
explained myself a little better this time.
 
J

Jeff Boyce

Nick

So you're saying that the only reason for the textbox is to (re-)display the
same items that are selected in the listbox?

Does your form have enough room to make your listbox 20 items "long"? That
way, folks could see what they've selected without having to look somewhere
else...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
N

Nick

Jeff-
I suppose that would probably be the simple solution. I think that I can
find enough room on my form for that. My only concern is that I have a report
based on the form and I would want to be able to print the multiple
selections is that possible? Thanks again for all your help.
 
J

Jeff Boyce

Nick

I may have missed something...

I thought the listbox held "business rules". Your response sounds like it
contains what is to be printed in the report.

I don't understand the (your) relationship between business rules and report
contents.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
N

Nick

Jeff -
I have a form that has multiple fields on it such as: report name, completed
by, report use, and business rules. The user can then click a button the form
that says "Print Report" which prints a report using all the information in
the fields of the form. So, if I have business rules on the form, when I
select, say 5, business rules in the list box I want those 5 to print on the
report with the other information on the form. Thanks for your help, sorry if
I am being confusing.
 
J

Jeff Boyce

I'll suggest you do an on-line search on "concatenation". It sounds like
you want a report to simply print out all the selected listbox items (and
other stuff). You'll need to concatenate those selections.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Top