Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    61

    Unanswered: need help with checkbox and "if" statement

    i have a pretty large database....
    I made a report and i need to use checkboxes...

    The fields that need to be displayed as checkboxes are text.

    I want the form checkbox to be checked if that field's value is "CHECKED"

    I realize that it's suppose to be a YES/NO but this database is linked to a mysql and cannot be changed.

    Is there an if statement i can put in a query? something like?

    if (MAIN.DUAL=CHECKED) {newfield="YES"}

    Where newfield is the field i'll put in the report instead of DUAL.


    thanks in advance
    Noam

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Something like: SELECT IIf(MyCheckBox=True,"CHECKED","NOT CHECKED") FROM SomeTable WHERE (SomeConditionApplies);

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I'm not sure if I'm reading this right or not, but are you wanting to set a checkbox based on text, or text based on a checkbox? I read it as setting a checkbox based on text, so something like this will work:

    You could do it directly in the report. Set a checkbox datasource to:

    =iif(dual = "checked", -1, 0)
    Last edited by Teddy; 01-07-04 at 10:43.

  4. #4
    Join Date
    Dec 2003
    Posts
    61
    i did almost just that but instead i used the "switch" command...

    I told it if true = yes, if fause=no

    It set yes as -1 and no as 0 automatically and it worked!
    thanks alot
    Noam

Posting Permissions

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