Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / December 2005

Tip: Looking for answers? Try searching our database.

Dumb Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim McColl - 08 Dec 2005 17:35 GMT
Hi - I'm stuck on a simple problem I am trying to display a true/false field
in a report, and instead of the default value of a checkbox, I want to print
"Yes" or "No"

I have tried various permutations of :  iif( [DBFld]=True,"Yes","No")   .

So far no luck - keep getting syntax failures. Could some one please tell me
the correct format of the above.

Thanks
Steve - 08 Dec 2005 18:06 GMT
I don't necessarily know about displaying the Yes/No as "Yes" and "No"
without adding a checkbox to the form (unless you can just create a
textbox and make it point to your Yes/No field without a formula), but
I can give you a workaround.

Create a CheckBox with your Yes/No field (we'll say "chkYesNo"). Create
a TextBox (we'll say "txtBox"). For the textbox, use this formula:

IIf(Forms!frmMyForm![chkYesNo].Value=True, "Yes", "No")

You may also want to try using VB constants instead of True and False.
e.g. IIf(...].Value=vbYes, "Yes", "No")

I don't know for sure if the value in a Yes/No field will correlate to
vbYes and vbNo, but you can give it a shot.
John Welch - 08 Dec 2005 18:45 GMT
Steve's first answer was the best, I believe .. use a text box on your
report whose control source is your yes/no field. Set the format of the
textbox to "yes/no" and whala.

>I don't necessarily know about displaying the Yes/No as "Yes" and "No"
> without adding a checkbox to the form (unless you can just create a
> textbox and make it point to your Yes/No field without a formula), but
> I can give you a workaround.
Tim Marshall - 08 Dec 2005 19:50 GMT
> in a report, and instead of the default value of a checkbox, I want to print
> "Yes" or "No"
>
> I have tried various permutations of :  iif( [DBFld]=True,"Yes","No")   .

Try:

iif([DBFld]=-1,"Yes","No")
Signature

Tim    http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto  "TIM-MAY!!" - Me

Jim McColl - 17 Dec 2005 15:27 GMT
>> in a report, and instead of the default value of a checkbox, I want to
>> print "Yes" or "No"
[quoted text clipped - 4 lines]
>
> iif([DBFld]=-1,"Yes","No")

Tim - Sorry to be so lomg in responding. My question wasn't as dumb as I
thought. Your suggested solution works like a charm, and I can see why, but
I never would have figured it out and could not find any "help" references.

Thanks very much and thanks also to the others for responding. This is a
great newsgroup
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.