Results 1 to 9 of 9

Thread: Toggle Button

  1. #1
    Join Date
    Mar 2004
    Posts
    361

    Unanswered: Toggle Button

    Does anyone know how to make a toggle button show the value of Yes/No in a report. Right now I have a form the is linked to a report and the user must press a toggle button but the report shows a -1. I would like it to say Yes/No. What property do I change.

    Thanks

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Set it with an iif().

    True false always returns -1 or 0.

    That's more or less a compatability issue.

    =iif(Toggle = -1, "True", "False")

  3. #3
    Join Date
    Mar 2004
    Posts
    361
    would I type =iif(Toggle = -1, "True", "False") into the control source of the text box in the report?

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    ayup.

    if toggle is true, then true, else false

  5. #5
    Join Date
    Mar 2004
    Posts
    361
    =IIf([txtTog]=-1,"True","False")

    That is what I have in a text box on the report. The name of the toggle button on my form txtTog.

    I am getting a #Name error in the report.

    What do you think it might be?

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You can't make a report based on a form.

    Where does your report get it's information.

  7. #7
    Join Date
    Mar 2004
    Posts
    361
    actually I have a bunch of text boxes with this type of code in them.

    =[Forms]![Term Worksheet]![txtYear]

    It just shows the value of the query on the form.

  8. #8
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Oh ok, are you being explicit with the txtTog?

    =IIf([Forms]![Term Worksheet]![txtTog].value =-1,"True","False")

  9. #9
    Join Date
    Mar 2004
    Posts
    361
    Great, we got a winner.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •