By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,739 Members | 1,523 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,739 IT Pros & Developers. It's quick & easy.

Showing a field in a form on a report if it's checked

P: n/a
Hey All,

I have a report that I would like to show a word on based on if a
field is checked in a form. For example. The form has a check box
called Fee. If that is checked, I want the word Paid to show up in the
report. If it's not checked, then I want it to not show.

Thanks for any help!
Nov 20 '07 #1
Share this Question
Share on Google+
11 Replies


P: n/a
On Tue, 20 Nov 2007 13:13:40 -0800 (PST), radink wrote:
Hey All,

I have a report that I would like to show a word on based on if a
field is checked in a form. For example. The form has a check box
called Fee. If that is checked, I want the word Paid to show up in the
report. If it's not checked, then I want it to not show.

Thanks for any help!
Is the field [Fee] included in the report's record source?
If so, then add an unbound text control to the report.
Set it's control source to:
=IIf([Fee] = True,"Paid","")

If the check box on the form is NOT included in the report's record
source, then add an unbound control to the report.
Set it's control source to:
=IIf(forms!FormName!Fee = True, "Paid","")

The form must be open when the report is run.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Nov 20 '07 #2

P: n/a
On Nov 20, 4:35 pm, fredg <fgutk...@example.invalidwrote:
On Tue, 20 Nov 2007 13:13:40 -0800 (PST), radink wrote:
Hey All,
I have a report that I would like to show a word on based on if a
field is checked in a form. For example. The form has a check box
called Fee. If that is checked, I want the word Paid to show up in the
report. If it's not checked, then I want it to not show.
Thanks for any help!

Is the field [Fee] included in the report's record source?
If so, then add an unbound text control to the report.
Set it's control source to:
=IIf([Fee] = True,"Paid","")

If the check box on the form is NOT included in the report's record
source, then add an unbound control to the report.
Set it's control source to:
=IIf(forms!FormName!Fee = True, "Paid","")

The form must be open when the report is run.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
I did option 2, since it's not linked. It works but doesn't. If it's
set to true it doesn't show on any of them, if I set it to false it
shows it on all of them. I do have the form open when Im running it.

Thanks!
Nov 20 '07 #3

P: n/a
On Nov 20, 2:56 pm, radink <radi...@gmail.comwrote:
On Nov 20, 4:35 pm, fredg <fgutk...@example.invalidwrote:


On Tue, 20 Nov 2007 13:13:40 -0800 (PST), radink wrote:
Hey All,
I have a report that I would like to show a word on based on if a
field is checked in a form. For example. The form has a check box
called Fee. If that is checked, I want the word Paid to show up in the
report. If it's not checked, then I want it to not show.
Thanks for any help!
Is the field [Fee] included in the report's record source?
If so, then add an unbound text control to the report.
Set it's control source to:
=IIf([Fee] = True,"Paid","")
If the check box on the form is NOT included in the report's record
source, then add an unbound control to the report.
Set it's control source to:
=IIf(forms!FormName!Fee = True, "Paid","")
The form must be open when the report is run.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

I did option 2, since it's not linked. It works but doesn't. If it's
set to true it doesn't show on any of them, if I set it to false it
shows it on all of them. I do have the form open when Im running it.

Thanks!- Hide quoted text -

- Show quoted text -
Since [Fee] is already True or False, omit the =True part in your IIF:
=IIf([Fee],"Paid","")

I've sometimes seen goofiness when using what evaluates to 'IF true =
true'.

HTH,
Jana
Nov 20 '07 #4

P: n/a
On Nov 20, 2:56 pm, radink <radi...@gmail.comwrote:
On Nov 20, 4:35 pm, fredg <fgutk...@example.invalidwrote:


On Tue, 20 Nov 2007 13:13:40 -0800 (PST), radink wrote:
Hey All,
I have a report that I would like to show a word on based on if a
field is checked in a form. For example. The form has a check box
called Fee. If that is checked, I want the word Paid to show up in the
report. If it's not checked, then I want it to not show.
Thanks for any help!
Is the field [Fee] included in the report's record source?
If so, then add an unbound text control to the report.
Set it's control source to:
=IIf([Fee] = True,"Paid","")
If the check box on the form is NOT included in the report's record
source, then add an unbound control to the report.
Set it's control source to:
=IIf(forms!FormName!Fee = True, "Paid","")
The form must be open when the report is run.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

I did option 2, since it's not linked. It works but doesn't. If it's
set to true it doesn't show on any of them, if I set it to false it
shows it on all of them. I do have the form open when Im running it.

Thanks!- Hide quoted text -

- Show quoted text -
correction, I did option 1, not 2, but everything still applies:
=IIf(forms!FormName!Fee, "Paid","")

Jana
Nov 20 '07 #5

P: n/a
"radink" <ra*****@gmail.comwrote
I did option 2, since it's not linked. It works but
doesn't. If it's set to true it doesn't show on any
of them, if I set it to false it shows it on all of
them. I do have the form open when Im running it.
Care to clarify "on any of them" and "on all of them"... any of them _whats_
and all of them _whats_ and just how is the field on the form related to
which of "them whats"?

I could guess that "them whats" are "records" displayed in the report, but
you need to confirm that, and explain how the report is supposed to
determine just which "them what" the value is supposed to apply.

Larry Linson
Microsoft Access MVP
Nov 21 '07 #6

P: n/a
On Nov 21, 12:25 am, "Larry Linson" <boun...@localhost.notwrote:
"radink" <radi...@gmail.comwrote
I did option 2, since it's not linked. It works but
doesn't. If it's set to true it doesn't show on any
of them, if I set it to false it shows it on all of
them. I do have the form open when Im running it.

Care to clarify "on any of them" and "on all of them"... any of them _whats_
and all of them _whats_ and just how is the field on the form related to
which of "them whats"?

I could guess that "them whats" are "records" displayed in the report, but
you need to confirm that, and explain how the report is supposed to
determine just which "them what" the value is supposed to apply.

Larry Linson
Microsoft Access MVP
Larry,

Sorry about that. All of them means all of the records that show up in
the report. The report shows about 3 lines from each record based on
the query of the report. When I was using the code above, That Paid
would show up on all of the sections or none at all, when it should
have been only some of them.
Thanks
Nov 21 '07 #7

P: n/a
On Nov 20, 5:36 pm, Jana <Bauer.J...@gmail.comwrote:
On Nov 20, 2:56 pm, radink <radi...@gmail.comwrote:
On Nov 20, 4:35 pm, fredg <fgutk...@example.invalidwrote:
On Tue, 20 Nov 2007 13:13:40 -0800 (PST), radink wrote:
Hey All,
I have a report that I would like to show a word on based on if a
field is checked in a form. For example. The form has a check box
called Fee. If that is checked, I want the word Paid to show up in the
report. If it's not checked, then I want it to not show.
Thanks for any help!
Is the field [Fee] included in the report's record source?
If so, then add an unbound text control to the report.
Set it's control source to:
=IIf([Fee] = True,"Paid","")
If the check box on the form is NOT included in the report's record
source, then add an unbound control to the report.
Set it's control source to:
=IIf(forms!FormName!Fee = True, "Paid","")
The form must be open when the report is run.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
I did option 2, since it's not linked. It works but doesn't. If it's
set to true it doesn't show on any of them, if I set it to false it
shows it on all of them. I do have the form open when Im running it.
Thanks!- Hide quoted text -
- Show quoted text -

correction, I did option 1, not 2, but everything still applies:
=IIf(forms!FormName!Fee, "Paid","")

Jana
Jana,

These did not work either. Im using it on a text box.. should i use
seomthing else?
Nov 21 '07 #8

P: n/a
On Nov 20, 5:36 pm, Jana <Bauer.J...@gmail.comwrote:
On Nov 20, 2:56 pm, radink <radi...@gmail.comwrote:
On Nov 20, 4:35 pm, fredg <fgutk...@example.invalidwrote:
On Tue, 20 Nov 2007 13:13:40 -0800 (PST), radink wrote:
Hey All,
I have a report that I would like to show a word on based on if a
field is checked in a form. For example. The form has a check box
called Fee. If that is checked, I want the word Paid to show up in the
report. If it's not checked, then I want it to not show.
Thanks for any help!
Is the field [Fee] included in the report's record source?
If so, then add an unbound text control to the report.
Set it's control source to:
=IIf([Fee] = True,"Paid","")
If the check box on the form is NOT included in the report's record
source, then add an unbound control to the report.
Set it's control source to:
=IIf(forms!FormName!Fee = True, "Paid","")
The form must be open when the report is run.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
I did option 2, since it's not linked. It works but doesn't. If it's
set to true it doesn't show on any of them, if I set it to false it
shows it on all of them. I do have the form open when Im running it.
Thanks!- Hide quoted text -
- Show quoted text -

correction, I did option 1, not 2, but everything still applies:
=IIf(forms!FormName!Fee, "Paid","")

Jana
I also tried something else. It seems like in the part "Paid","") it's
using nothing. If I add something in the second set of "" it puts that
in all of the records on the report. So it's not working correctly.
Nov 21 '07 #9

P: n/a
On Wed, 21 Nov 2007 06:22:47 -0800 (PST), radink <ra*****@gmail.com>
wrote:
>On Nov 20, 5:36 pm, Jana <Bauer.J...@gmail.comwrote:
>On Nov 20, 2:56 pm, radink <radi...@gmail.comwrote:
On Nov 20, 4:35 pm, fredg <fgutk...@example.invalidwrote:
On Tue, 20 Nov 2007 13:13:40 -0800 (PST), radink wrote:
Hey All,
I have a report that I would like to show a word on based on if a
field is checked in a form. For example. The form has a check box
called Fee. If that is checked, I want the word Paid to show up in the
report. If it's not checked, then I want it to not show.
Thanks for any help!
Is the field [Fee] included in the report's record source?
If so, then add an unbound text control to the report.
Set it's control source to:
=IIf([Fee] = True,"Paid","")
If the check box on the form is NOT included in the report's record
source, then add an unbound control to the report.
Set it's control source to:
=IIf(forms!FormName!Fee = True, "Paid","")
The form must be open when the report is run.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
I did option 2, since it's not linked. It works but doesn't. If it's
set to true it doesn't show on any of them, if I set it to false it
shows it on all of them. I do have the form open when Im running it.
Thanks!- Hide quoted text -
- Show quoted text -

correction, I did option 1, not 2, but everything still applies:
=IIf(forms!FormName!Fee, "Paid","")

Jana

Jana,

These did not work either. Im using it on a text box.. should i use
seomthing else?
A text box should work just fine. You need to let the report know
which records should show as "Paid" and which ones not. The easiest
way is probably to include "Fee" as a field in the query that is the
RecordSource for the report. Then the code that several people have
supplied (Iif([Fee], "Paid", "") will work.
Nov 21 '07 #10

P: n/a
Hi -

On the form that calls the report, is the check box "Fee" bound to a field in
the underlying recordset? If it's not, then what does it refer to?
Presumably each item is either paid or it isn't, so the Fee data has to be
included in the data for each record, and then made a part of the query for
the report as well.

If the Fee checkbox *is* bound to a data field, then the problem is that the
report is referring to whatever record is on the form at the time the report
is run, and that is the same one for each record the report prints.

HTH

John
radink wrote:
> I did option 2, since it's not linked. It works but
doesn't. If it's set to true it doesn't show on any
[quoted text clipped - 11 lines]
> Larry Linson
Microsoft Access MVP

Larry,

Sorry about that. All of them means all of the records that show up in
the report. The report shows about 3 lines from each record based on
the query of the report. When I was using the code above, That Paid
would show up on all of the sections or none at all, when it should
have been only some of them.
Thanks
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200711/1

Nov 21 '07 #11

P: n/a
On Nov 21, 7:18 am, radink <radi...@gmail.comwrote:
On Nov 21, 12:25 am, "Larry Linson" <boun...@localhost.notwrote:


"radink" <radi...@gmail.comwrote
I did option 2, since it's not linked. It works but
doesn't. If it's set to true it doesn't show on any
of them, if I set it to false it shows it on all of
them. I do have the form open when Im running it.
Care to clarify "on any of them" and "on all of them"... any of them _whats_
and all of them _whats_ and just how is the field on the form related to
which of "them whats"?
I could guess that "them whats" are "records" displayed in the report, but
you need to confirm that, and explain how the report is supposed to
determine just which "them what" the value is supposed to apply.
Larry Linson
Microsoft Access MVP

Larry,

Sorry about that. All of them means all of the records that show up in
the report. The report shows about 3 lines from each record based on
the query of the report. When I was using the code above, That Paid
would show up on all of the sections or none at all, when it should
have been only some of them.
Thanks- Hide quoted text -

- Show quoted text -
So, your Fee field on your form is a bound field, not an unbound
checkmark? Each record contains a Fee checkbox? If that is the case,
you need to include this in your query so it will check on each record
and make a decision of whether or not to put the word "Paid". What's
happening is your report is looking to the current record on the
form. If the record you happen to be on when you open the report has
Fee checked, then it's showing the word Paid on every record. If not,
then you get nothing for each record.

Add a calculated field to your query like this (Paste this into a
blank column in your query):

IsPaid: IIF([Fee],"Paid","")

Then add the IsPaid field to your report next to the details of each
record.

HTH,
Jana
Nov 21 '07 #12

This discussion thread is closed

Replies have been disabled for this discussion.