Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    Sep 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    If then else statement in Word 2000 (2000)

    Hello

    I am trying to make a if-then-else statement that looks at a numeric field
    in GoldMine and if the field says 0.00 then print nothing.

    I am missing the boat big time here!

    This is what I have so far:

    {IF {DDEAUTO GoldMine Data Contact2->UINHOUSHRS*CHARFORMAT}="0.00" THEN
    "{TOTEXT " "}" ELSE {DDEAUTO GoldMine Data Contact2->UINHOUSHRS #"0.00"}}

    The TOTEXT is what you would use in Crystal Reports - what is the equivalent
    in Word? And if I screwed up anything else - what is it?

    TIA for any help
    Andrea

  2. #2
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: If then else statement in Word 2000 (2000)

    Hi Andie,

    I'm not sure that you need an IF test for what you're doing. Try the following instead:
    {DDEAUTO GoldMine Data Contact2-UINHOUSHRS # ,#.00;-,#.00;}
    The numeric format at the end tells the field to display +ve & -ve results only (whith '000 separators), but not 0. Be sure to include the semi-colon at the end.

    Cheers
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  3. #3
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: If then else statement in Word 2000 (2000)

    Hi Andrea:
    I see macropod has already answered your question, but just to point out what's wrong with the IF field.
    1. You shouldn't use quotes for the condition (i.e. the "0.00")
    2. You don't use the word "THEN". You simply have a space after the condition & put the result that you want (in quotes) when the condition is true.
    3. Similarly, you don't use the word "ELSE", just a space & the false result. So the syntax would be:
    {IF {DDEAUTO GoldMine Data Contact2->UINHOUSHRS*CHARFORMAT}=0 "{TOTEXT " "}" {DDEAUTO GoldMine Data Contact2->UINHOUSHRS #"0.00"}}

    although I don't know what the quotes in the field "{TOTEXT " "} are for, but I assume you have some field by this name.

    Cheers,

  4. #4
    New Lounger
    Join Date
    Sep 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: If then else statement in Word 2000 (2000)

    Worked like a charm - thank you so much for the help.

    Is there some sort of book that goes over this type of thing in detail?

  5. #5
    New Lounger
    Join Date
    Sep 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: If then else statement in Word 2000 (2000)

    The ToText is what you would use in Crystal Reports to say if these conditions are met then use this text. If you look at the whole formula I was approaching it like it was a formula for Crystal

    Do you know of any books that go over Word formulas in detail?

    Thanks!

  6. #6
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: If then else statement in Word 2000 (2000)

    Hi Andie:
    Using Word 2000 (Que) by Bill Camarda seems to have a lot in basic instructions for field syntax. The Help files are also reasonably good. Also, see macropod's <post#=176420>post 176420</post#>. I haven't looked at the "Running" series on Word that Microsoft Press publishes, but I suspect they have it. My old User's Guide that came with Word 6 was pretty good...but Microsoft seems to think that books are a thing of the past. <img src=/S/sigh.gif border=0 alt=sigh width=15 height=15>

Posting Permissions

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