Dynamic report using listbox

J

JString

Ok I know you're all probably wondering why the heck do I want to use a list
box on a report? The thing is that I have an idea for a dynamic report and
the listbox seems to be the perfect control help make this possible. Instead
of creating an array of several controls spanning the width of the report
detail section, they could all be replaced by a single list box. The idea is
to use code to configure its column count, column widths and row data based
on info gathered from the user before the form is launched.

The problem is that I don't know exactly how to go about this yet. I tried
setting the report record source, listbox row source type to 'table/query'
and listbox rowsource to the same source as the report. As it is, the report
will display one listbox for every record in its source, and each listbox
displays data but only for one record. Does anybody know how I might get
each successive box to get data from the next record?

Thanks in advance.
 
M

Marshall Barton

JString said:
Ok I know you're all probably wondering why the heck do I want to use a list
box on a report? The thing is that I have an idea for a dynamic report and
the listbox seems to be the perfect control help make this possible. Instead
of creating an array of several controls spanning the width of the report
detail section, they could all be replaced by a single list box. The idea is
to use code to configure its column count, column widths and row data based
on info gathered from the user before the form is launched.

The problem is that I don't know exactly how to go about this yet. I tried
setting the report record source, listbox row source type to 'table/query'
and listbox rowsource to the same source as the report. As it is, the report
will display one listbox for every record in its source, and each listbox
displays data but only for one record. Does anybody know how I might get
each successive box to get data from the next record?


I can't help with using a list box because I can't see any
benefit over using a subreport. At least a subreport
control has the CanGrow property, LinkMaster/Child
properties and its report object will display all records
that are related to each mainreport record.
 
J

JString

The bottom line is that I want to be able to programatically customize the
number of columns displayed in the report. A sub query would allow me to do
this, but I don't know of any way to control font size or column widths in a
query's datasheet view. The records that referenced on this report have a
large number of fields which causes the report to print one record across 2
pages, or if in a subreport, many of the fields are cut off. If I could get
this to work on a listbox, I could set the font sizes and column widths
beforehand.
 

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