Highlight matched detail based on subreport in group footer

N

NeoFax

I have a report that has a subreport in the group footer. I want to
highlight(either conditional format or onformat of detail section)
when data in the subreport matches info in the detail. I have not
been able to figure out how to do this and do not want the opposite by
highlighting the subreport. Thanks!
 
E

Evi

You haven't made it clear whether you want to format a section of the
subreport when something in it matches the parent report, or if you want to
format something in the Parent report when a certain value appears in the
subreport.
Please clarify. An example would be a good idea.

Do you want to format a control or a section? if a section then you won't be
able to use conditional formatting.
Evi
 
N

NeoFax

You haven't made it clear whether you want to format a section of the
subreport when something in it matches the parent report, or if you want to
format something in the Parent report when a certain value appears in the
subreport.
Please clarify. An example would be a good idea.

Do you want to format a control or a section? if a section then you won't be
able to use conditional formatting.
Evi






- Show quoted text -

I want to highlight the parent detail section if something matches the
subreport. I would prefer using conditionalformatting, but if only the
parent detail onformat works then I am fine with this as well. Below
is an example:

detail section
txtJobCard txtDescription txtHours txtPercent txtState
subreport detail section (located in group footer)
txtJCNum txtMaterialNum txtQuantity txtMaterialDescription

If txtJobCard = txtJCNum, then I want to highlight txtJobCard by
conditional formatting or the whole line by "OnFormat" code. Thanks!
 
E

Evi

- Show quoted text -

You haven't made it clear whether you want to format a section of the
subreport when something in it matches the parent report, or if you want to
format something in the Parent report when a certain value appears in the
subreport.
Please clarify. An example would be a good idea.

Do you want to format a control or a section? if a section then you won't be
able to use conditional formatting.
Evi

I want to highlight the parent detail section if something matches the
subreport. I would prefer using conditionalformatting, but if only the
parent detail onformat works then I am fine with this as well. Below
is an example:

detail section
txtJobCard txtDescription txtHours txtPercent txtState
subreport detail section (located in group footer)
txtJCNum txtMaterialNum txtQuantity txtMaterialDescription

If txtJobCard = txtJCNum, then I want to highlight txtJobCard by
conditional formatting or the whole line by "OnFormat" code. Thanks!

Evi writes:
So it's not the section, but txtJobCard which is in the Main form that you
want to highlight. OK, then you can use Conditional Formatting, click on
txtJobCard and type next to Expression Is:

[RptYourSub].[Report].[txtJCNum]=[txtJobCard]

replacing RptYourSub with the name of your subreport as it appears in the
Properties box when you click on it.
Evi
 
N

NeoFax

- Show quoted text -
You haven't made it clear whether you want to format a section of the
subreport when something in it matches the parent report, or if you want to
format something in the Parent report when a certain value appears in the
subreport.
Please clarify. An example would be a good idea.
Do you want to format a control or a section? if a section then you won't be
able to use conditional formatting.
Evi

I want to highlight the parent detail section if something matches the
subreport. I would prefer using conditionalformatting, but if only the
parent detail onformat works then I am fine with this as well.  Below
is an example:

detail section
   txtJobCard   txtDescription  txtHours  txtPercent  txtState
subreport detail section (located in group footer)
   txtJCNum  txtMaterialNum  txtQuantity txtMaterialDescription

If txtJobCard = txtJCNum, then I want to highlight txtJobCard by
conditional formatting or the whole line by "OnFormat" code.  Thanks!

Evi writes:

So it's not the section, but txtJobCard which is in the Main form that you
want to highlight.  OK, then you can use Conditional Formatting, click on
txtJobCard and type next to Expression Is:

[RptYourSub].[Report].[txtJCNum]=[txtJobCard]

replacing RptYourSub with the name of your subreport as it appears in the
Properties box when you click on it.
Evi- Hide quoted text -

- Show quoted text -

I tried that, but it does not work. I am assuming the reason being is
that the subreport has no value when the detail section is checking as
the subreport is in a footer section and not in the same section as
txtJobCard. Would this make any difference?
 
E

Evi

- Show quoted text -
You haven't made it clear whether you want to format a section of the
subreport when something in it matches the parent report, or if you want to
format something in the Parent report when a certain value appears in the
subreport.
Please clarify. An example would be a good idea.
Do you want to format a control or a section? if a section then you
won't
be
able to use conditional formatting.
Evi

I want to highlight the parent detail section if something matches the
subreport. I would prefer using conditionalformatting, but if only the
parent detail onformat works then I am fine with this as well. Below
is an example:

detail section
txtJobCard txtDescription txtHours txtPercent txtState
subreport detail section (located in group footer)
txtJCNum txtMaterialNum txtQuantity txtMaterialDescription

If txtJobCard = txtJCNum, then I want to highlight txtJobCard by
conditional formatting or the whole line by "OnFormat" code. Thanks!

Evi writes:

So it's not the section, but txtJobCard which is in the Main form that you
want to highlight. OK, then you can use Conditional Formatting, click on
txtJobCard and type next to Expression Is:

[RptYourSub].[Report].[txtJCNum]=[txtJobCard]

replacing RptYourSub with the name of your subreport as it appears in the
Properties box when you click on it.
Evi- Hide quoted text -

- Show quoted text -

I tried that, but it does not work. I am assuming the reason being is
that the subreport has no value when the detail section is checking as
the subreport is in a footer section and not in the same section as
txtJobCard. Would this make any difference?

I've just tested it out, and it doesn't seem to make any difference. I've
put my main report's control in both the Group Header and in the Detail
section. I've put the subreport in the group footer. it still worked. Check
the names of your controls and check that the values do meet the criteria.
I must say that I've tried this with a linked subreport. Is you sub linked
to the main report?
Evi
 
N

NeoFax

I want to highlight the parent detail section if something matches the
subreport. I would prefer using conditionalformatting, but if only the
parent detail onformat works then I am fine with this as well. Below
is an example:
detail section
txtJobCard txtDescription txtHours txtPercent txtState
subreport detail section (located in group footer)
txtJCNum txtMaterialNum txtQuantity txtMaterialDescription
If txtJobCard = txtJCNum, then I want to highlight txtJobCard by
conditional formatting or the whole line by "OnFormat" code. Thanks!
Evi writes:
So it's not the section, but txtJobCard which is in the Main form that you
want to highlight. OK, then you can use Conditional Formatting, click on
txtJobCard and type next to Expression Is:
[RptYourSub].[Report].[txtJCNum]=[txtJobCard]

replacing RptYourSub with the name of your subreport as it appears in the
Properties box when you click on it.
Evi- Hide quoted text -
- Show quoted text -

I tried that, but it does not work.  I am assuming the reason being is
that the subreport has no value when the detail section is checking as
the subreport is in a footer section and not in the same section as
txtJobCard.  Would this make any difference?

I've just tested it out, and it doesn't seem to make any difference. I've
put my main report's control in both the Group Header and in the Detail
section. I've put the subreport in the group footer. it still worked. Check
the names of your controls and check that the values do meet the criteria.
I must say that I've tried this with a linked subreport. Is you sub linked
to the main report?
Evi- Hide quoted text -

- Show quoted text -

OK, all of the controls match what the name states in the properties.
My subreport is linked to the main report from two other fields not
txtJobCard or txtJCNum. How would I go about checking what the value
of txtJCNum is when the report is opened? In the debug immediate
window?
 
N

NeoFax

"NeoFax" <[email protected]> wrote in message
I have a report that has a subreport in the group footer. I want to
highlight(either conditional format or onformat of detail section)
when data in the subreport matches info in the detail. I have not
been able to figure out how to do this and do not want the opposite by
highlighting the subreport. Thanks!- Hide quoted text -
- Show quoted text -
You haven't made it clear whether you want to format a section of the
subreport when something in it matches the parent report, or if you want
to
format something in the Parent report when a certain value appears in the
subreport.
Please clarify. An example would be a good idea.
Do you want to format a control or a section? if a section then you won't
be
able to use conditional formatting.
Evi
I want to highlight the parent detail section if something matches the
subreport. I would prefer using conditionalformatting, but if only the
parent detail onformat works then I am fine with this as well. Below
is an example:
detail section
txtJobCard txtDescription txtHours txtPercent txtState
subreport detail section (located in group footer)
txtJCNum txtMaterialNum txtQuantity txtMaterialDescription
If txtJobCard = txtJCNum, then I want to highlight txtJobCard by
conditional formatting or the whole line by "OnFormat" code. Thanks!
Evi writes:
So it's not the section, but txtJobCard which is in the Main form thatyou
want to highlight. OK, then you can use Conditional Formatting, click on
txtJobCard and type next to Expression Is:
[RptYourSub].[Report].[txtJCNum]=[txtJobCard]
replacing RptYourSub with the name of your subreport as it appears in the
Properties box when you click on it.
Evi- Hide quoted text -
- Show quoted text -
I tried that, but it does not work.  I am assuming the reason being is
that the subreport has no value when the detail section is checking as
the subreport is in a footer section and not in the same section as
txtJobCard.  Would this make any difference?
I've just tested it out, and it doesn't seem to make any difference. I've
put my main report's control in both the Group Header and in the Detail
section. I've put the subreport in the group footer. it still worked. Check
the names of your controls and check that the values do meet the criteria.
I must say that I've tried this with a linked subreport. Is you sub linked
to the main report?
Evi- Hide quoted text -
- Show quoted text -

OK, all of the controls match what the name states in the properties.
My subreport is linked to the main report from two other fields not
txtJobCard or txtJCNum.  How would I go about checking what the value
of txtJCNum is when the report is opened?  In the debug immediate
window?- Hide quoted text -

- Show quoted text -

Here is how I solved my problem:
Added a text box with a dlookup to check the query of the subreport.
If the criteria matches the text box is filled with data. Then I use
the onformat of the detail section to color the backcolor if the added
text box has data. I could not get the conditional format to work (in
txtJobCard the expression is states: [txtTest]>1) for some reason. If
you could help me with that, I would appreciate it.
 
E

Evi

I have a report that has a subreport in the group footer. I want to
highlight(either conditional format or onformat of detail section)
when data in the subreport matches info in the detail. I have not
been able to figure out how to do this and do not want the opposite by
highlighting the subreport. Thanks!- Hide quoted text -
- Show quoted text -
You haven't made it clear whether you want to format a section of the
subreport when something in it matches the parent report, or if you want
to
format something in the Parent report when a certain value appears
in
the
subreport.
Please clarify. An example would be a good idea.
Do you want to format a control or a section? if a section then you won't
be
able to use conditional formatting.
Evi
I want to highlight the parent detail section if something matches the
subreport. I would prefer using conditionalformatting, but if only the
parent detail onformat works then I am fine with this as well. Below
is an example:
detail section
txtJobCard txtDescription txtHours txtPercent txtState
subreport detail section (located in group footer)
txtJCNum txtMaterialNum txtQuantity txtMaterialDescription
If txtJobCard = txtJCNum, then I want to highlight txtJobCard by
conditional formatting or the whole line by "OnFormat" code. Thanks!
Evi writes:
So it's not the section, but txtJobCard which is in the Main form that you
want to highlight. OK, then you can use Conditional Formatting, click on
txtJobCard and type next to Expression Is:
[RptYourSub].[Report].[txtJCNum]=[txtJobCard]
replacing RptYourSub with the name of your subreport as it appears in the
Properties box when you click on it.
Evi- Hide quoted text -
- Show quoted text -
I tried that, but it does not work. I am assuming the reason being is
that the subreport has no value when the detail section is checking as
the subreport is in a footer section and not in the same section as
txtJobCard. Would this make any difference?
I've just tested it out, and it doesn't seem to make any difference. I've
put my main report's control in both the Group Header and in the Detail
section. I've put the subreport in the group footer. it still worked. Check
the names of your controls and check that the values do meet the criteria.
I must say that I've tried this with a linked subreport. Is you sub linked
to the main report?
Evi- Hide quoted text -
- Show quoted text -

OK, all of the controls match what the name states in the properties.
My subreport is linked to the main report from two other fields not
txtJobCard or txtJCNum. How would I go about checking what the value
of txtJCNum is when the report is opened? In the debug immediate
window?- Hide quoted text -

- Show quoted text -

Here is how I solved my problem:
Added a text box with a dlookup to check the query of the subreport.
If the criteria matches the text box is filled with data. Then I use
the onformat of the detail section to color the backcolor if the added
text box has data. I could not get the conditional format to work (in
txtJobCard the expression is states: [txtTest]>1) for some reason. If
you could help me with that, I would appreciate it.

Just make sure that you have the correct name for your subreport. When in
Design view of the Main report, click on the subreport and look next to Name
in the Properties box (don't look next to DataSource)
The conditional format really ought to work. Of course, if you are looking
for a text value,you know that you have to put Quote marks around it, don't
you? And looking for a date has all sorts of twiddly rules.
But I did get the impression that you were looking for a number so I'm
scraping the barrel here.

This is going to haunt me! When I said check what is in your control, I just
meant visually. I know it sounds like a silly thing to say, but I have
actually done that and wondered why a format didn't happen. It turned out I
had got my < mixed up with my > (very nasty!) and was looking for a value
that never was going to exist.

If your Conditional Format says [txtTest[>1 then you (or some other evil
party) must have typed it there. As far as I know, Access doesn't fill in
the conditional format for itself (unless this is a feature of the post-2000
versions).

Evi
 

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