Changing a 'Static' report to a 'Dynamic' one

P

pwdpwd

Hi

I'd be really grateful for any pointers for a problem that is driving me nuts!
I am trying to change a 'static' report into a 'dynamic' one.

I have a scheduling application, originally written in Access 97 which
generates service dates for trucks - usually around 8-10 'Service Dates' per
year. One of the features of the app is that 1 report shows on one page (A4
landscape) all the trucks, grouped by Owner, that have a Service Date in each
week - 53 columns wide!

I managed that by creating a select query and then into a CrossTab Query,
where the Owner & Vehicle Reg No are the row headings and a Count of the
Value of the Service Date gives me the 53 columns (there can only ever be 1
Service Date in any 1 week) with a '1' in each of the 53 columns where a
service date is scheduled. Because of the limitations of space with 53
columns, I used an If statement in the Control Source of fields for each of
the 53 columns on the report, replacing an 'X' in a Non-Blank field from the
query.

I couldnt make the report dynamic, as Access 97 didnt allow Vertical text, so
I made the select query 'Static' by using the year as criteria for a
formatted expression of the Service Date so as to include the correct dates.
Those queries and that report works fine.

I then needed to add an indication of when an MOT was to take place (always
done on a service date); I did this by having a select query that shows the
dates when an MOT is due (indicated by the user via an option button against
each service date), then to a CrossTab (using the same principles as
described above) and a Subreport which works fine on its own. I include this
subreport invisibly on the main report, again for each year. I use the Contol
source of the fields in the main report to check whether the equivalent field
in the subreport is Non Blank, in which case I show a 'T' - else an 'X' or
nothing. This report also works fine.

I now am bringing the app up to date and I want to make it dynamic, by having
the user input a year, and then have the report produce the relevant data
automatically. I now have a 'generic' report fed by select and CrossTab
queries where the select query criteria requires an input from the user in
the format for the Year; on its own, this report works fine..

The problem is that when I include the subreport, fed by equivalent generic
queries requiring a similar input, the report will not work. On running the
report I have to input the year from the 'main' query, but instead of being
required to input the year for the subreport once, I am prompted to enter the
year dozens (or even hundreds) of times. When I replace the criteria in the
subreport select query with a number for a year (and hence make it 'non-
generic' then the report works fine.

I know that I could create another 10 years worth of queries and reports, but
know that there must be a better way.

Thanks for any help.
 
S

Steve

Would you be interested in a calendar report that looks just like a page
torn from a wall calendar that displays any selected month and shows the
service dates for the month? A different service date can be shown on each
day. A calendar form is also available. I provide help with Access, Excel
and Word applications for a small fee. I could implement the form and report
into your database for only a small fee. If you are interested, contact me.

Steve
(e-mail address removed)
 
J

John... Visio MVP

Steve said:
Would you be interested in a calendar report that looks just like a page
torn from a wall calendar that displays any selected month and shows the
service dates for the month? A different service date can be shown on each
day. A calendar form is also available. I provide help with Access, Excel
and Word applications for a small fee. I could implement the form and
report into your database for only a small fee. If you are interested,
contact me.

Steve


So stevie, whose code did you plagerize?

Stevie is our own personal pet troll who is the only one who does not
understand the concept of FREE peer to peer support!

These newsgroups are provided by Microsoft for FREE peer to peer support.
There are many highly qualified individuals who gladly help for free. Stevie
is not one of them, but he is the only one who just does not get the idea of
"FREE" support. He offers questionable results at unreasonable prices. If he
was any good, the "thousands" of people he claims to have helped would be
flooding him with work, but there appears to be a continuous drought and he
needs to constantly grovel for work.

John... Visio MVP
 
J

Jeff Boyce

These newsgroups are 'staffed' by (mostly) volunteers. The Code of Conduct
for these 'groups precludes soliciting paid work.

If you get solicited, you might want to ask yourself if you're willing to do
business with someone who ignores the rules.


If you need your user to be able to specify a "year" for the report, here's
one approach:

Create a form.
Add a control for the user to enter the "year".
Modify the query you use to feed your report so that it uses the form's
control's value as the criterion.
Add a command button on the form to open the report.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
P

pwdpwd via AccessMonster.com

Thanks for all the pointers - very helpful indeed - will give them a try

Duane said:
If I understand, you should be able to use the gantt style report in the
Calendar Reports download at http://www.access.hookom.net/Samples.htm.

There is a sample of the report output at
http://www.access.hookom.net/Images/GanttSchedule.jpg. The "table" displayed
is just a subreport to show the source data and would not normally be
included in the main report.
[quoted text clipped - 51 lines]
 

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