image based on value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Access XP 2003 - I am moving our school student reports to Access. one of the
reports that we need to do are called Year2net. Unfortunately they use an
image instead of a grade on the printout. I need to setup an image to change
on the report based on a Ture/False control. eg. the user opens a form to
answer a series of Yes/No or True/False questions. when the user prints out a
report, if the answer to question one is 'Yes' then image1 is used on the
report next to the question, if the answer to question one is 'No' then
image2 is used on the report next to the question and so on. I am using
images because conditional formating does not allow for a diagonal line to
be drawn inside a square box, the
 
... they use an image instead of a grade on
the printout. I need to setup an image to
change on the report based on a Ture/False
control. eg. the user opens a form to answer
a series of Yes/No or True/False questions.
when the user prints out a report, if the ans-
wer to question one is 'Yes' then image1 is
used on the report next to the question, if the
answer to question one is 'No' then image2
is used on the report next to the question and
so on. I am using images because conditional
formating does not allow for a diagonal line to
be drawn inside a square box, the . . .

What you need to tell us is how the data that the user enters in the Form is
stored in the Table.

Presumably if the user enters Yes/No data, it would be stored in a Yes/No
(aka Boolean) field. If that is the case, then some VBA code in the Print
event of the Detail Section of the Report could test the field, and select
the appropriate path-and-filename to set into the Picture property of an
Image Control.

The sample imaging databases at http://accdevel.tripod.com illustrate three
approaches to handling images in Access, and the download includes an
article discussing considerations in choosing an approach. Two of the
approaches do not use OLE Objects and, thus, avoid the database bloat, and
some other problems, associated with images in OLE Objects.

As you are printing the images in reports, to avoid memory leakage, you
should also see MVP Stephen Lebans' http://www.lebans.com/printfailures.htm.
PrintFailure.zip is an Access97 MDB containing a report that fails during
the Access formatting process prior to being spooled to the Printer Driver.
This MDB also contains code showing how to convert the contents of the Image
control to a Bitmap file prior to printing. This helps alleviate the "Out of
Memory" error that can popup when printing image intensive reports.

But, since you are using image files just for symbols, you can probably
store them as bitpmaps in advance and save yourself some work.

On the other hand, you might save yourself a lot of work if you searched the
web and found a font... one of the thousands of symbol fonts available...
that included the kind of box-with-slash that you need. If you have a few
graphics programs on your machine, you probably, like me, have uncounted
fonts that you have never examined in detail.

Larry Linson
Microsoft Access MVP
 
Back
Top