Results 1 to 8 of 8
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Expression Error (2002 SP-2)

    I've about beat this to death trying to discover the error. Time to ask for help.
    IIF([txtCustomerNo] Like"SIM*",SUM([TotalBilledCalc]),0)) is the control source of a txtbx in a continuous form; it returns a #Name? error. Both fields are valid and included in the detail section (the txtbx I'm getting the error is located in the footer). Little help?
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Expression Error (2002 SP-2)

    Try this:

    =IIF([txtCustomerNo] Like ('SIM') & '*',SUM([TotalBilledCalc]),0))
    Regards,

    Gary
    (It's been a while!)

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Expression Error (2002 SP-2)

    Gary:
    <img src=/S/bullseye.gif border=0 alt=bullseye width=45 height=15> . . .Thanks!
    (BTW, one too many ")" at the end)
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Expression Error (2002 SP-2)

    Gary:

    Not getting the intended result (my bad expression). It is returning the the sum of every record in the continuous form, rather than the total for records with txtCustomerNo Like "SIM" (ie. SIMAG, SIMFE, etc).
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

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

    Re: Expression Error (2002 SP-2)

    That is because the order of IIf and Sum is reversed.
    <pre>=Sum(IIf([txtCustomerNo] Like "SIM*",[TotalBilledCalc],0))
    </pre>

    I also simplified the Like expression a bit.

  6. #6
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Expression Error (2002 SP-2)

    Hans:

    Thank you. One of these days. . . .
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

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

    Re: Expression Error (2002 SP-2)

    >> One of these days. . .

    Your gonna kill me? <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

  8. #8
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Expression Error (2002 SP-2)

    <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15>

    No way friend!
    One of these days I'm going to either learn this stuff, or die a slightly disturbed individual.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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