Dumb Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jim McColl

    #1

    Dumb Question

    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

    #2
    Re: Dumb Question

    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!frmMy Form![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.

    Comment

    • John Welch

      #3
      Re: Dumb Question

      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.

      "Steve" <theonesteve@gm ail.com> wrote in message
      news:1134065205 .122232.144860@ g14g2000cwa.goo glegroups.com.. .[color=blue]
      >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.
      >[/color]


      Comment

      • Tim Marshall

        #4
        Re: Dumb Question

        Jim McColl wrote:
        [color=blue]
        > 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 ") .[/color]

        Try:

        iif([DBFld]=-1,"Yes","No")
        --
        Tim http://www.ucs.mun.ca/~tmarshal/
        ^o<
        /#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
        /^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me

        Comment

        • Jim McColl

          #5
          Re: Dumb Question


          "Tim Marshall" <TIMMY!@PurpleP andaChasers.Moe rtherium> wrote in message
          news:dna2q4$dfk $1@coranto.ucs. mun.ca...[color=blue]
          > Jim McColl wrote:
          >[color=green]
          >> 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 ") .[/color]
          >
          > Try:
          >
          > iif([DBFld]=-1,"Yes","No")
          > --
          > Tim http://www.ucs.mun.ca/~tmarshal/
          > ^o<
          > /#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
          > /^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me[/color]


          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


          Comment

          Working...