Multi-select listbox for report

S

Scott

I have a report based on a parameter query to select the data for my report.
Now, I need to select more than one name in a name field so I think I need
to change to multi-select listbox to accomplish it. Can someone give me a
sample to construct it.

Thanks,

Scott
 
S

Scott

Allen,

Many thanks for your useful pointer. I have successfully created the
multi-select listbox for the report but have the following points that need
your further advice.

1. I changed your example with following area and works. Are they all
about the variables to be changed?

Remove the single quote of 'strDelim = .... as the field is text.
Replace strDoc with my report name.
Replace [CategoryID] with the field to which the criteria is set.

2. Regarding the notes 2, you mention the column() property is zero-based.
I am using Access 2003 and the listbox has three fields and the field is
used to be set the criteria is the second one. According to your notes2, I
should set bound column to 1 but I need to set to 2 to make it work. Did I
misunderstand your meaning?

Thanks,

Scott
 
A

Allen Browne

Look at the RowSource property of your list box. You should see at least 3
fields listed in the SELECT clause.

Look at the Column Widths property. If the first column is zero-width, you
won't see it. Therefore Column(0) is zero-width, and Column(1) is the first
visible column, even though it is actually the 2nd column in the combo.

Is that what's going on?

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Scott said:
Allen,

Many thanks for your useful pointer. I have successfully created the
multi-select listbox for the report but have the following points that
need your further advice.

1. I changed your example with following area and works. Are they all
about the variables to be changed?

Remove the single quote of 'strDelim = .... as the field is text.
Replace strDoc with my report name.
Replace [CategoryID] with the field to which the criteria is set.

2. Regarding the notes 2, you mention the column() property is
zero-based. I am using Access 2003 and the listbox has three fields and
the field is used to be set the criteria is the second one. According to
your notes2, I should set bound column to 1 but I need to set to 2 to make
it work. Did I misunderstand your meaning?

Thanks,

Scott

Allen Browne said:
See:
Use a multi-select list box to filter a report
at:
http://allenbrowne.com/ser-50.html
 
S

Scott

Allen,

In the properties of the listbox,

Row source = 3 fields.
Column count = 3
Column widths = 0";1";0"
Bound column = 2

Obviously, the listbox outputs the column 2 (also the visible column) and
the criteria will be set to column 2. I can change the bound column to 1 or
3 eventhough I cannot see it in the listbox.

According to you note, the bound column should be 1 and probably you are
referring to other thing, not the relationship of above three properties.

Please forgive me if my question is a silly one.

Thanks,

Scott


Allen Browne said:
Look at the RowSource property of your list box. You should see at least 3
fields listed in the SELECT clause.

Look at the Column Widths property. If the first column is zero-width, you
won't see it. Therefore Column(0) is zero-width, and Column(1) is the
first visible column, even though it is actually the 2nd column in the
combo.

Is that what's going on?

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Scott said:
Allen,

Many thanks for your useful pointer. I have successfully created the
multi-select listbox for the report but have the following points that
need your further advice.

1. I changed your example with following area and works. Are they all
about the variables to be changed?

Remove the single quote of 'strDelim = .... as the field is text.
Replace strDoc with my report name.
Replace [CategoryID] with the field to which the criteria is set.

2. Regarding the notes 2, you mention the column() property is
zero-based. I am using Access 2003 and the listbox has three fields and
the field is used to be set the criteria is the second one. According to
your notes2, I should set bound column to 1 but I need to set to 2 to
make it work. Did I misunderstand your meaning?

Thanks,

Scott

Allen Browne said:
See:
Use a multi-select list box to filter a report
at:
http://allenbrowne.com/ser-50.html

I have a report based on a parameter query to select the data for my
report. Now, I need to select more than one name in a name field so I
think I need to change to multi-select listbox to accomplish it. Can
someone give me a sample to construct it.
 
A

Allen Browne

Okay: Column(2) is the 3rd column, which is also zero-width.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Scott said:
Allen,

In the properties of the listbox,

Row source = 3 fields.
Column count = 3
Column widths = 0";1";0"
Bound column = 2

Obviously, the listbox outputs the column 2 (also the visible column) and
the criteria will be set to column 2. I can change the bound column to 1
or 3 eventhough I cannot see it in the listbox.

According to you note, the bound column should be 1 and probably you are
referring to other thing, not the relationship of above three properties.

Please forgive me if my question is a silly one.

Thanks,

Scott


Allen Browne said:
Look at the RowSource property of your list box. You should see at least
3 fields listed in the SELECT clause.

Look at the Column Widths property. If the first column is zero-width,
you won't see it. Therefore Column(0) is zero-width, and Column(1) is the
first visible column, even though it is actually the 2nd column in the
combo.

Is that what's going on?

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Scott said:
Allen,

Many thanks for your useful pointer. I have successfully created the
multi-select listbox for the report but have the following points that
need your further advice.

1. I changed your example with following area and works. Are they all
about the variables to be changed?

Remove the single quote of 'strDelim = .... as the field is text.
Replace strDoc with my report name.
Replace [CategoryID] with the field to which the criteria is set.

2. Regarding the notes 2, you mention the column() property is
zero-based. I am using Access 2003 and the listbox has three fields and
the field is used to be set the criteria is the second one. According
to your notes2, I should set bound column to 1 but I need to set to 2 to
make it work. Did I misunderstand your meaning?

Thanks,

Scott

See:
Use a multi-select list box to filter a report
at:
http://allenbrowne.com/ser-50.html

I have a report based on a parameter query to select the data for my
report. Now, I need to select more than one name in a name field so I
think I need to change to multi-select listbox to accomplish it. Can
someone give me a sample to construct it.
 

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