Conditional Display Problem in a Report

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I have a query that returns two "source" fields for a publication: an
"internet" source and a "print" source.

This query is used as the record source for a report that displays only one
source field.

If the "print" source is not null, I want the report to display the print
source field. Otherwise I want it to display the internet source field.

What is the "best practice" for approaching this problem? Do I
programmatically set the control source for my "source" field textbox? Or
do I create two source field textboxes in my report and set the visibility
of one of them to false based on the value in the "print" source field?

And what report event should I code against in this case?

Thanks for any ideas
Dave
 
I have a query that returns two "source" fields for a publication: an
"internet" source and a "print" source.

This query is used as the record source for a report that displays only one
source field.

If the "print" source is not null, I want the report to display the print
source field. Otherwise I want it to display the internet source field.

What is the "best practice" for approaching this problem? Do I
programmatically set the control source for my "source" field textbox? Or
do I create two source field textboxes in my report and set the visibility
of one of them to false based on the value in the "print" source field?

And what report event should I code against in this case?

Thanks for any ideas
Dave

Both fields are included in the report's record source, right?

Use an unbound control in the report.
=IIf(IsNull([PrintSource]),[InternetSource],[PrintSource])
 
Dave said:
I have a query that returns two "source" fields for a publication: an
"internet" source and a "print" source.

This query is used as the record source for a report that displays
only one source field.

If the "print" source is not null, I want the report to display the
print source field. Otherwise I want it to display the internet
source field.

What is the "best practice" for approaching this problem? Do I
programmatically set the control source for my "source" field
textbox? Or do I create two source field textboxes in my report and
set the visibility of one of them to false based on the value in the
"print" source field?

And what report event should I code against in this case?

Thanks for any ideas
Dave

I've not understand how yo choose it, but you can use one control
with IIf(YouCriteria;True part;False Part)

--
_ _
Ciao
MAssimiliano Amendola www.accessgroup.it
Cisa - Conferenza Italiana per Sviluppatori Access
Info: www.donkarl.com/it
 
Yes. That works fine.

Thank you fredg & MA



fredg said:
I have a query that returns two "source" fields for a publication: an
"internet" source and a "print" source.

This query is used as the record source for a report that displays only
one
source field.

If the "print" source is not null, I want the report to display the print
source field. Otherwise I want it to display the internet source field.

What is the "best practice" for approaching this problem? Do I
programmatically set the control source for my "source" field textbox?
Or
do I create two source field textboxes in my report and set the
visibility
of one of them to false based on the value in the "print" source field?

And what report event should I code against in this case?

Thanks for any ideas
Dave

Both fields are included in the report's record source, right?

Use an unbound control in the report.
=IIf(IsNull([PrintSource]),[InternetSource],[PrintSource])
 
fredg,
Hello,

This is very good idea. I tried your this idea but it does not work when I
want to use same source query from more than one forms. For Example I want to
use same field from 2 or 3 forms then what will be the solution?

Thanks

Nadeem

fredg said:
I have a query that returns two "source" fields for a publication: an
"internet" source and a "print" source.

This query is used as the record source for a report that displays only one
source field.

If the "print" source is not null, I want the report to display the print
source field. Otherwise I want it to display the internet source field.

What is the "best practice" for approaching this problem? Do I
programmatically set the control source for my "source" field textbox? Or
do I create two source field textboxes in my report and set the visibility
of one of them to false based on the value in the "print" source field?

And what report event should I code against in this case?

Thanks for any ideas
Dave

Both fields are included in the report's record source, right?

Use an unbound control in the report.
=IIf(IsNull([PrintSource]),[InternetSource],[PrintSource])
 
fredg,
Hello,

This is very good idea. I tried your this idea but it does not work when I
want to use same source query from more than one forms. For Example I want to
use same field from 2 or 3 forms then what will be the solution?

Thanks

Nadeem

fredg said:
I have a query that returns two "source" fields for a publication: an
"internet" source and a "print" source.

This query is used as the record source for a report that displays only one
source field.

If the "print" source is not null, I want the report to display the print
source field. Otherwise I want it to display the internet source field.

What is the "best practice" for approaching this problem? Do I
programmatically set the control source for my "source" field textbox? Or
do I create two source field textboxes in my report and set the visibility
of one of them to false based on the value in the "print" source field?

And what report event should I code against in this case?

Thanks for any ideas
Dave

Both fields are included in the report's record source, right?

Use an unbound control in the report.
=IIf(IsNull([PrintSource]),[InternetSource],[PrintSource])

I don't know because you haven't really explained what you mean.

You will be better off by starting your own thread and be a bit more
specific with what you want to do. An example will be nice also, as
what may be perfectly clear to you may be unclear to others.
 
Back
Top