Hiding Report Section on Data

G

Guest

Hi,
I have read the question: 'Hide a section based on contents at run time' and
followed the recommendations but the groupheaders were hiden on the data of
the first record and not reassessed for each record.
My situation is as follows:
Page Header
Group header 1 [this contains an image]
Group header 2 [this contains an image]
Details
When there is no image in eather group header1 or 2 I need it to be removed.
I have tried: cancel = Not HasData
but it does not work for each record only the first.
Regards
Theresa
 
G

Guest

You need code in the On Format event of the section to hide like:

Cancel = Len(Me.txtImageName & "") = 0
 
G

Guest

Thanks Duane,
Your solution would not work because the field is an image not a string.
However, I did solve the problem by creating a flag (yes/no) to indicate the
presence of the image and then used:
cancel = Not ImageFlag
in the Format event and it works just fine.
**********************************************

Duane Hookom said:
You need code in the On Format event of the section to hide like:

Cancel = Len(Me.txtImageName & "") = 0

--
Duane Hookom
Microsoft Access MVP


Theresa said:
Hi,
I have read the question: 'Hide a section based on contents at run time' and
followed the recommendations but the groupheaders were hiden on the data of
the first record and not reassessed for each record.
My situation is as follows:
Page Header
Group header 1 [this contains an image]
Group header 2 [this contains an image]
Details
When there is no image in eather group header1 or 2 I need it to be removed.
I have tried: cancel = Not HasData
but it does not work for each record only the first.
Regards
Theresa
 

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