I am trying to generate a report whose source is a form and that only prints fields that are not null.
To do so I have two text-boxes for every field. They are both resizealbe (can shrink/grow).
The first text-box is for the caption, and its source is
=IIf([record] Is Null,"","Caption:")
The second is the record value itself. If record is null then the value of both text-boxes is “” and null and they do not appear nor take any space in the form.
Two question:
- This doesn’t seem like the smartest way to do it. Anyone has a better idea?
- The report also contains check-boxes, and this method only works if I check/uncheck at least one check-box before I generate the report. Otherwise all captions appear anyway. This is very weird – anyone has any idea why it happens?
This will only work properly with Print Preview, not MS Access 2010 report or layout view. You will need Can Shrink on the control to close up the gaps. In Access 2010, “*_Label” is the default name assigned to labels of controls.