Presumably you have 3 tables:
1. Company table, with CompanyID primary key;
2. Category table, with CategoryID primary key;
3. CompanyCategory table, with fields like this:
CompanyID relates to Company.CompanyID
CategoryID relates to Category.CategoryID
So, if company ABC has 3 categories, they have 3 *records* in the 3rd table.
You interface this with:
- a main form bound to the Company table, and
- a subform bound to the CompanyCategory table.
The subform has a combo for selecting the categories.
You enter as many rows as you need in the 3rd table for the company in the
main form.
You can now create the report you want. Create a query that uses all 3
tables, and use it as the source for your report.
Once you get that working, you can use a multi-select list box to filter the
report if you wish. Details in:
Use a multi-select list box to filter a report
at:
http://allenbrowne.com/ser-50.html
However, you do not use a multi-select list box as the interface for the
form where users to add/remove/edit the data.
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"CY" <(E-Mail Removed)> wrote in message
news:WYUui.56362$Fc.46412@attbi_s21...
>I am really new to VBA but have been using Access for a while, although I
>am bit rusty as I haven't used it consistently lately...
>
> My question...I would like to use a multi select list box on a form, which
> I have made so that it LOOKS correct, but I can't make it actually store
> the data in the underlying table. I am pretty sure I will need to write
> code to do it, but I am not sure if this is really the solution I am
> looking for...
>
> I need the user to be able to select categories, and then create a report
> that lists every business that is using that category. So for example...
>
> ABC company will have 3 categories: Recreation, Children's Products and
> Childrens Parties.
> XYZ Company will have 2 categories: Recreation, Mom's Products
> 123 Company will have 4 categories: Home Products, Safety, Business
> Solutions and Health
>
> Then the report that I will create from the table will list as follows:
>
> Recreation:
> ABC Company
> XYZ Company
>
> Childrens Products:
> ABC Company
>
> Children's Parties:
> ABC Company
>
> Mom's Products:
> XYZ Company
>
> etc etc etc
>
> After I hit a block there I created a field for every category and just
> made it Yes/No on the table, but this is going to cause me problems when I
> try to make a report and if the user wants to add categories, not to
> mention it's sloppy. Looks good on the form, but that's about it. So if
> anyone has any ideas that I can use to accomplish this I would really
> appreciate it. Hopefully it's not really simple and I have missed it!
>
> Hope this makes sense...can anyone help?
>
> TIA
>
> CY