Linking a field with a display in a report conditional on whether a record exist

D

Dieter

I have a report based on a query which draws fields from
7 tables in my database. Firstly, I want one of the
fields in the detail band of my report to appear only if
there is a record in that field. Secondly, if there is
data in the field I would like to show a series of
rectangle boxes next to field.
Is it possible to link the display of boxes drawn into
the detail band of a report based on whether or not
records appear in a particular field? (I suppose the
series of boxes could be saved as an image bmp and then
linked to the field?)
I'd appreciate your advice.
Thanks, Dieter
 
M

Marshall Barton

Dieter said:
I have a report based on a query which draws fields from
7 tables in my database. Firstly, I want one of the
fields in the detail band of my report to appear only if
there is a record in that field. Secondly, if there is
data in the field I would like to show a series of
rectangle boxes next to field.
Is it possible to link the display of boxes drawn into
the detail band of a report based on whether or not
records appear in a particular field? (I suppose the
series of boxes could be saved as an image bmp and then
linked to the field?)


"record in that field" is confusing. Fields don't have
records, fields have data. It's records that have fields
(and the thingies on reports are controls).

If you meant that you only want to display a control (text
box?) if its bound field is not null or a zero length
string, then you can use code in the detail section's Format
event to make that and other controls visible or invisible
as needed:

If Me.thetextbox & "" = "" Then 'check for data
' nothing in the field
Me.thetextbox.Visible = False
Me.rectangle1.Visible = False
Me.rectangle2.Visible = False
. . .
Else
' the field has something in it
Me.thetextbox.Visible = True
Me.rectangle1.Visible = True
Me.rectangle2.Visible = True
. . .
End If

If you meant something other than what I thought you meant,
post back with more infiemation.
 

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