Printing with OLE objects

  • Thread starter Thread starter Nmidia
  • Start date Start date
N

Nmidia

Hi,

I am trying to find a solution to the following problem;

*staff update a database throughoout a day, making changes to records
as they progress jobs.
*at the end of each day one member of staff collects all work packs
that have been completed.
*That member of staff prints a set of letters, specific to each work
pack, and staples them to the front of the work packs. These are then
posted.

The letter changes depending on what is ticked within the database.
There are two basic types of letter; one where a charge is to be paid,
and one where the charge has been waivered. This is controlled on the
form using a yes/no chk box.

I have a query set up so that they simply have to enter the date for
the letters being printed, and the database prints the entire set.
This works fine, picking up the different addresses and dates etc
(specific to each letter). However, I can not get the system to
display the different standard letter dependent on whether the tick box
is set to yes or no. It works fine when looking up the value at form
load, but when printing a set of letters for mulitple records, all the
letters are defaulted to the same as the first letter.

e.g.
1/ charged
2/ waivered
3/ charged

I would like the database to print;
1/ Charged letter
2/. Waivered letter
3/ Charged letter

However, it prints
1/ chaged letter
2/ chaged letter
3/ chaged letter.

I have tried using forms and reports to do this. Any suggestions
welcomed! I'm probably being really thick!

Cheers in advance
 
Nmidia said:
Hi,

I am trying to find a solution to the following problem;

*staff update a database throughoout a day, making changes to records
as they progress jobs.
*at the end of each day one member of staff collects all work packs
that have been completed.
*That member of staff prints a set of letters, specific to each work
pack, and staples them to the front of the work packs. These are then
posted.

The letter changes depending on what is ticked within the database.
There are two basic types of letter; one where a charge is to be paid,
and one where the charge has been waivered. This is controlled on the
form using a yes/no chk box.

I have a query set up so that they simply have to enter the date for
the letters being printed, and the database prints the entire set.
This works fine, picking up the different addresses and dates etc
(specific to each letter). However, I can not get the system to
display the different standard letter dependent on whether the tick box
is set to yes or no. It works fine when looking up the value at form
load, but when printing a set of letters for mulitple records, all the
letters are defaulted to the same as the first letter.

e.g.
1/ charged
2/ waivered
3/ charged

I would like the database to print;
1/ Charged letter
2/. Waivered letter
3/ Charged letter

However, it prints
1/ chaged letter
2/ chaged letter
3/ chaged letter.

I have tried using forms and reports to do this. Any suggestions
welcomed! I'm probably being really thick!

Cheers in advance

It's not really clear from your post how you want to print your
multiple letters. If for example you are trying to create a form with
a command button on it that prints all the letters at once for all
packs and the collation order does not matter, then you would need to
create two reports, one which prints all charged letters, and one which
prints all waivered letters, and simply put two docmd.openreport
commands in the click event of the button, e.g.

DoCmd.OpenReport "rptChargedLetters_All"
DoCmd.OpenReport "rptWaivered Letters_All"

If the collation order does matter (if for example the letters need to
be printed in pack order) then there are a number of ways to do this.
One method would be to create a master report with two subreports in
it. The master report would be based on your pack table. One
subreport would be the charged letter and the other would be the
waivered letter. In the detail format event of the master report you
could simply make one subreport visible and the other not visible based
on the value of the tick box field. Another would be to create a loop
in VBA in the click event of the button that iterates through each pack
record and prints the appropriate letter based on the tick box field,
something like

If <tick box field> then
DoCmd.OpenReport "rptChargedLetter"
else
DoCmd.OpenReport "rptWaiveredLetter"
end if

I hope this at least gets you on the right track. If you can provide
more information perhaps the group can be of more help.

Bruce
 
Thanks for the info,

its option 2 that I want to do, so I will give the sub report thing a
try. I'll let you know how it goes.

Cheers again!
 

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

Back
Top