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

When Checkbox is Checked on Form, want report to print Yes/No

P: 3
I was assigned the task of creating a small database by my office.
I created a table with the appropriate field ID, Project, and Approve (checkbox). Then I created a Form of the table.

But when I run my reports I see the actual check boxes. I am trying to understand what I am doing wrong.

What I would like to happen is when a person clicks the approve check box it says yes on the report, and when the check box is not checked it should say no.

Any help would be greatly appreciated.
Dec 18 '08 #1
Share this Question
Share on Google+
6 Replies

Expert Mod 10K+
P: 14,534
On the report make the check box control invisible but don't delete it. Assuming check box is called "Check1" then do the following.

Add a new text box control to the report and place it where you want the "Yes" to display. Set the control source of the new check box to the following.

Expand|Select|Wrap|Line Numbers
  1. =IIf([Check1]=-1,"Yes","No")
Dec 18 '08 #2

P: 3
It worked thank you, I have a question im new to programming what does the IIF mean?
Dec 18 '08 #3

Expert Mod 10K+
P: 14,534
IIf(<expression>,If True, If False)

It is essentially an IF statement. Essentially it says if whatever expression you use before the first comma is true then use value between first and second comma otherwise use value after second comma.

You can use any expression before the first comma in the form of ...

Expand|Select|Wrap|Line Numbers
  1. [Field Name]="xxx" (for a string)
  2. [Field Name] Like "Bl*" (when you want all strings beginning with Bl)
  3. [Field Name]=2 (For a number)
  4. [Field Name]>2 (For all numbers higher than 2)
  5. [Field Name]<2 (For all numbers lower than 2)
  6. [Field Name]=#22/10/2008# (For a date)
Dec 19 '08 #4

Expert 2.5K+
P: 3,532
To continue Mary's explanation, IIF stands for Imediate IF. Essentially it's a shortcut for

Expand|Select|Wrap|Line Numbers
  1. If <whatever> Then
  2.   <Do this>
  3. Else
  4.   <Do something else>
  5. End If
Welcome to Bytes!

Linq ;0)>
Dec 19 '08 #5

P: 3
Thank You

I got it to work, but I must have misunderstood what I was suppose to do. The check box is fine but what they wanted was two check boxes. One that says "Yes" and another box next to it that say "No". Depending on which box you check the word should be written on the report.

I have to pics of my project so far. Can something like this be done?
Attached Images
File Type: jpg project.jpg (14.4 KB, 139 views)
File Type: jpg Project2.jpg (14.8 KB, 113 views)
Dec 19 '08 #6

Expert Mod 15k+
P: 31,494
Radio Buttons are better for such, mutually exclusive, options. If Yes=True then No=False and If Yes=False then No=True.

An Option Group control will be required to contain the Radio Buttons.

On the report a TextBox with a value of something like :
Expand|Select|Wrap|Line Numbers
  1. =IIf(optGroup=1,"Yes","No")
Dec 23 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.