conditional formatting reports

D

dom.hastings

i need some help with conditional formating reports.

i have a database which is a campsite booking system. there is a
customer table, a booking table, a campers table and a site table. in
the booking table there is a calculated field called booking cost.
there is also a amount paid and an amount outstanding field(which is
calculated from booking cost - amount paid).

i want to add a function so if the amount outstanding is 0 a
report(entitled payment recieved) is generated and if there is a value
in the amount outstanding a different report(entitled payment reminder)
is generated.

i know i will have to do this all through a conditionally formatted
query but i cant think how im going to go about it.

so far ive managed to produce the payment reminder report but it is
created for every booking, even if the amount outstanding is 0
 
J

Jeff Cox

i need some help with conditional formating reports.

i have a database which is a campsite booking system. there is a
customer table, a booking table, a campers table and a site table. in
the booking table there is a calculated field called booking cost.
there is also a amount paid and an amount outstanding field(which is
calculated from booking cost - amount paid).

i want to add a function so if the amount outstanding is 0 a
report(entitled payment recieved) is generated and if there is a value
in the amount outstanding a different report(entitled payment reminder)
is generated.

i know i will have to do this all through a conditionally formatted
query but i cant think how im going to go about it.

so far ive managed to produce the payment reminder report but it is
created for every booking, even if the amount outstanding is 0

If you open the report from a form individually, then put the code on
the OnClick event of a button.

If Me.amountpaid > 0 then
DoCmd.OpenReport "paymentReceived", acViewPreview
Else
DoCmd.OpenReport "paymentreminder", acViewPreview
End if

Another way would be to create two queries. One to find the amountpaid =
0 and one to find those with amountpaid > 0.

Then make your two reports bound to the relevant query. Then when you
open each report, it is already filtered and you can print all of them
in one go.

There may be a better way, but this will get you going.

Hope it helps,

Jeff Cox
 
D

dom.hastings

the report would be pulled up from the switchboard so i think i may try
the two reports option
 

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