Conditional Formatting

  • Thread starter Thread starter Lisa
  • Start date Start date
L

Lisa

i have a report that has 5 subreports on it. In my page header I have 2 text
boxes one called Field0 which displays Store Name and Field4 which displays
the Total % Change for the quarter. In one of the sub form which is in the
detail section of the report I have a list of about 90 stores and there %
change per month and for the quarter. This report also has txt boxes named
Field0 which has store name and Field4 which has Total % change. I want to
format Field0 in the subreport to show store name if it equals Field0 in the
reports page header. and if it does not equal Field0 in teh page header I wan
tit to hide the store name. Let me make it clear I wan tall of the other
information to how up in the detail section. All of the % changes for the 90
stores just not the store name unless it equals the name in the page header.
Can anyone help me I have been working on this for 5 days with no end in
site?
 
In the OnCurrent of the subform you could place something like:

if me.field0=me.parent.field0 then
me.field0.visible=false
else
me.field0.visible=true
end if

hth
 
The code you gave does the trick with one catch, I get an error 2452
Expression you entered is invalad reference to parent property. I should say
the sub report is not bound to the main report, they are not linked by a
field and I can not link them either, I have already tried that. Can you help
solve the error?
 
Lisa,

How about trying this one:

if me.field0=forms!frmMainform!field0 then
me.field0.visible=false
else
me.field0.visible=true
end if

where frmMainform shoud be the name of your mainform.

hth
 
Back
Top