Results 1 to 6 of 6

Thread: if print (2003)

  1. #1
    rlbroerman
    Guest

    if print (2003)

    I am trying to print the word "he" if there is a "1" in the sex field in the patient table with "=If(patient.sex=1,"he","she")" but it doesn't work. Any ideas?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: if print (2003)

    I presume that you have this code in a text field on a report?
    You should use iif not if.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: if print (2003)

    Rick, keep your replies to the lounge, in that way others may learn as well, it also gives all in the lounge the opportunity to help you.

    BTW iif does work. Maybe the reference to patient.sex is not correct, you will probably only need to use sex and not patient.sex, but I'm guessing here as I don't know if you are using a query or a table as the Record Source of your report.

  4. #4
    rlbroerman
    Guest

    Re: if print (2003)

    Thanks it works except that when I open the report it says "Enter Parameter Value"
    I click on "OK" and it prints the "false part" even though my table has 1's and 2's in it.
    can you help again? Thanks

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: if print (2003)

    There is probably a small typo somewhere - a misspelled field name. The prompt in the "Enter parameter value" window should give you a clue what to look for. Check very carefully - one character (even a space) can make the difference.

  6. #6
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: if print (2003)

    Hi,
    Based on your posts, I am assuming that Patient.Sex is the name of a field. If this is the case try : =IIF([Patient.Sex]=1,"He","She"). Usually you end up with a Parameter value if the calculation cannot find a source; in this case the field values!
    Regards,
    Rudi

Posting Permissions

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