L
Larry
I have to create a travel itinerary for a database I just created for a
large project that does a lot of traveling in our company. Now that I am at
the end of it, they do not like the printed itinerary I produced!
Basically I created 3 subreports. One for flight information, another for
hotel and another for car rental. I put these three subreports on a report
which has the traveler information at the top of the report. So the report
first shows all the flights the user will be taking (in departure order),
then all the hotels they will be staying in (sorted in arrival order) and
then all the car rentals (in pickup date order). The problem now, though, is
that the user wants the report to be completely sorted by date/time! So they
get the flight(s) first, then the hotels and car rental, then the return
flights.
Ok, so that I could probably do. But, since many of these engineers are
traveling all over the world to some holes in the wall, they could have
something like 2 flights, a hotel stay, then 3 flights, another hotel stay
and a car rental, then another flight and a hotel stay then another 4
flights to get home. And, you can do that in just about any order you want
with just about as many different ways as you can dream of.
I have been able to put a Union query together to get the PK's for each of
the records that would need to be printed, in the proper date order. So I
"could" probably put this into some kind of grid type report. But no, the
user does not want a grid. They want it sectioned and then information on
the report in what Access would call "Columnar" style. That was the main
reason I went with the subreports in the first place.
My ONLY thought is to try to figure out how to loop through this query I
created, get the associated subReport for the current record and add it to a
new report, dynamically, and set the filter for that report to that
particular PK (or range of PK's if there might be multiple records in a row,
i.e. flights).
But, first I don't know how to do this (yet) and second I bet this is a bad
idea. I can just imagine how large this database would become, creating and
destroying reports on the fly. It's just that I cannot think of any other
way to do this, other than the dynamic approach.
Does anyone have any other ideas? Can anyone tell me how to go about
creating a report from VBA and adding subReports in this manner?
Thanks for reading all this confusing problem.
large project that does a lot of traveling in our company. Now that I am at
the end of it, they do not like the printed itinerary I produced!
Basically I created 3 subreports. One for flight information, another for
hotel and another for car rental. I put these three subreports on a report
which has the traveler information at the top of the report. So the report
first shows all the flights the user will be taking (in departure order),
then all the hotels they will be staying in (sorted in arrival order) and
then all the car rentals (in pickup date order). The problem now, though, is
that the user wants the report to be completely sorted by date/time! So they
get the flight(s) first, then the hotels and car rental, then the return
flights.
Ok, so that I could probably do. But, since many of these engineers are
traveling all over the world to some holes in the wall, they could have
something like 2 flights, a hotel stay, then 3 flights, another hotel stay
and a car rental, then another flight and a hotel stay then another 4
flights to get home. And, you can do that in just about any order you want
with just about as many different ways as you can dream of.
I have been able to put a Union query together to get the PK's for each of
the records that would need to be printed, in the proper date order. So I
"could" probably put this into some kind of grid type report. But no, the
user does not want a grid. They want it sectioned and then information on
the report in what Access would call "Columnar" style. That was the main
reason I went with the subreports in the first place.
My ONLY thought is to try to figure out how to loop through this query I
created, get the associated subReport for the current record and add it to a
new report, dynamically, and set the filter for that report to that
particular PK (or range of PK's if there might be multiple records in a row,
i.e. flights).
But, first I don't know how to do this (yet) and second I bet this is a bad
idea. I can just imagine how large this database would become, creating and
destroying reports on the fly. It's just that I cannot think of any other
way to do this, other than the dynamic approach.
Does anyone have any other ideas? Can anyone tell me how to go about
creating a report from VBA and adding subReports in this manner?
Thanks for reading all this confusing problem.