Report generation

D

Daniel

Hello,

I created a simple report. However, the users now want to be able to
control in which way the data gets sorted which project get included.... I
originally was trying to create several report one for each requirement and
control which one is visible depending on the selections made on a form.
However, I now am wondering if there wouldn't be a smatter approach such as
creating a report on the fly using VBA. I was wondering what the Pros would
recommend? Any good starting sample db I could be referred to?!

Thanks,

Daniel
 
M

Marshall Barton

Daniel said:
I created a simple report. However, the users now want to be able to
control in which way the data gets sorted which project get included.... I
originally was trying to create several report one for each requirement and
control which one is visible depending on the selections made on a form.
However, I now am wondering if there wouldn't be a smatter approach such as
creating a report on the fly using VBA. I was wondering what the Pros would
recommend? Any good starting sample db I could be referred to?!


You're right to look for a way to get away from multiple
versions of the same report. But, constructing reports at
runtime is very definitely not the way to go. Instead, use
code in the report's Open event to change the report's
properties according to the user specified sort field.

Since a report's sorting is specified in the report's design
using hte Sorting and Grouping window (View menu), that's
what needs to be modifed:

Me.GroupLevel(x).ControlSource = Forms!theform.txtsortfield

Check Help for GroupLevel for details and other properties
you can set.
 

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