Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2003
    Location
    FL
    Posts
    50

    Unanswered: I really need asap help please...

    Hi,

    "2ND REQUEST"

    I have created a report in Access 2000. While using following condition in the value of the field, I am getting error...

    iif ([APPRVALUE]=0,[SALESPRICE],[APPRVALUE])

    It gives error for all records that has APPRVALUE(>0). Now if I change as...

    iif ([APPRVALUE]=0,[APPRVALUE],[SALESPRICE])

    it gives error for all records that has SALESPRICE(>0).

    If I enter as...

    iif ([SALESPRICE]=0,[APPRVALUE],[SALESPRICE])

    it gives error for all records that has SALESPRICE(>0). !!!!!!!!!!!

    In other words, what ever I have as FALSE part (non-zero), it would give me an error!!

    Any idea please???

  2. #2
    Join Date
    Oct 2002
    Location
    Greensboro, NC
    Posts
    50

    Re: I really need asap help please...

    Hi,
    what's the error your getting?


    Originally posted by Sandeep Munshi
    Hi,

    "2ND REQUEST"

    I have created a report in Access 2000. While using following condition in the value of the field, I am getting error...

    iif ([APPRVALUE]=0,[SALESPRICE],[APPRVALUE])

    It gives error for all records that has APPRVALUE(>0). Now if I change as...

    iif ([APPRVALUE]=0,[APPRVALUE],[SALESPRICE])

    it gives error for all records that has SALESPRICE(>0).

    If I enter as...

    iif ([SALESPRICE]=0,[APPRVALUE],[SALESPRICE])

    it gives error for all records that has SALESPRICE(>0). !!!!!!!!!!!

    In other words, what ever I have as FALSE part (non-zero), it would give me an error!!

    Any idea please???

  3. #3
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    sounds like you may need to an NZ function
    determine if you get this error on a value of zero or if there is no value (null)

    if it is on null values place NZ in the front of the iif and enclose everything but the nz within parens

    NZ()

  4. #4
    Join Date
    Apr 2003
    Location
    FL
    Posts
    50

    Re: I really need asap help please...

    Originally posted by tjacobs
    Hi,
    what's the error your getting?
    Thanks for your response.

    It says #Error !!

  5. #5
    Join Date
    Apr 2003
    Location
    FL
    Posts
    50
    Originally posted by axsprog
    sounds like you may need to an NZ function
    determine if you get this error on a value of zero or if there is no value (null)

    if it is on null values place NZ in the front of the iif and enclose everything but the nz within parens

    NZ()
    I tried like...

    =nz(iif([saleprice]=0,[apprvalue],[saleprice]),0)

    Now it gives #Error in all records! Did I do anything wrong?

  6. #6
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    these are two examples that Microsoft documents for the iif function

    =IIf([Confirmed] = "Yes", "Order Confirmed", "Order Not Confirmed")
    =IIf(IsNull([Country]), " ", [Country])


    your code says

    =nz(iif([saleprice]=0,[apprvalue],[saleprice]),0)

    why are you using the ",0" ?

    your statement reads if the saleprice = 0 then give saleprice the value
    of apprvalue else keep the sale price value
    why are you using the 0

    try to hardcode the values, maybe you are trying to update a number field with a string

    but the best way to determine if the code will run at all is use hardcoded values

    =nz(iif([saleprice]=0,5,25))

    remove the NZ as well


    =iif([saleprice]=0,5,25)

    and test where the values are in fact 0 or another integer and see if they change to 5 or 25

  7. #7
    Join Date
    Apr 2003
    Location
    FL
    Posts
    50
    Originally posted by axsprog
    these are two examples that Microsoft documents for the iif function

    =IIf([Confirmed] = "Yes", "Order Confirmed", "Order Not Confirmed")
    =IIf(IsNull([Country]), " ", [Country])


    your code says

    =nz(iif([saleprice]=0,[apprvalue],[saleprice]),0)

    why are you using the ",0" ?

    your statement reads if the saleprice = 0 then give saleprice the value
    of apprvalue else keep the sale price value
    why are you using the 0

    try to hardcode the values, maybe you are trying to update a number field with a string

    but the best way to determine if the code will run at all is use hardcoded values

    =nz(iif([saleprice]=0,5,25))

    remove the NZ as well


    =iif([saleprice]=0,5,25)

    and test where the values are in fact 0 or another integer and see if they change to 5 or 25
    Oh My God!! What a foolish mistake I made...

    Actually I tried every suggestions, nothing worked!!
    Finally I realized that The name of my text Box was "SALEPRICE" and the field name is also "SALEPRICE", both same!!
    I just changed the name of the text box as saleprice1 and everything is OK now!!!!!
    What a foolish mistake on my part...
    Anyways, I thank all of you guys who helped me with this problem. And I hope this idiot mistake would help some one to stop ggaist making this type of mistake(s). Well I know though that no one could be same foolish...
    Thanks again...
    Sandeep

  8. #8
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    there are no stupid questions only stupid answers

    (a quote from my 5th grade english teacher)

  9. #9
    Join Date
    Oct 2002
    Location
    Greensboro, NC
    Posts
    50

    Talking

    Originally posted by Sandeep Munshi
    Oh My God!! What a foolish mistake I made...

    Actually I tried every suggestions, nothing worked!!
    Finally I realized that The name of my text Box was "SALEPRICE" and the field name is also "SALEPRICE", both same!!
    I just changed the name of the text box as saleprice1 and everything is OK now!!!!!
    What a foolish mistake on my part...
    Anyways, I thank all of you guys who helped me with this problem. And I hope this idiot mistake would help some one to stop ggaist making this type of mistake(s). Well I know though that no one could be same foolish...
    Thanks again...
    Sandeep
    I know I've made the same mistake and I am totally sure we are not the only ones!

Posting Permissions

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