I'm getting an error with: =IIf([CNUM]="PERMA1",[Required], "")
*if the Customer# = "Perma1" then show field the [Required] else blank.
I am able to return a text string, but NOT the data that I need to display.
I'm getting an error with: =IIf([CNUM]="PERMA1",[Required], "")
*if the Customer# = "Perma1" then show field the [Required] else blank.
I am able to return a text string, but NOT the data that I need to display.
where are you using this code? in a query, a form or report or vba?
and what does this mean?
but the data that I need to display
Where are you using the expression, and what is the error message?
Just as a guess, though, a field called [CNum] would usually contain numeric data (judging by its name), and you are comparing it to a string which cannot be evaluated as a number.
In a report. I meant to say "but the NOT the data that I need to display"
I am using it in a report. The error is Invalid Control Source and Circular Reference.
The CNUM (customer number) is a text field of 5 alphas and 1 numeric.
if the Customer is Perma Pipe ([CNUM= "PERMA1) then show the QC ranges ([Required]) on the report, otherwise don't show anything
What is the name of the text box in your report? I'm guessing if you check the Name attribute on the All tab of the property sheet, it will say CNum. With this being the case, the Iif expression is referring to itself, hence the circular reference error. Probably the easiest way to resolve is to update the Name property to be something like "CNum_Conditional". Really anything other than CNum should work.
Feel free to reach out to info@superaccessninjas.com if you need more guidance.
What is the name of the text box in your report? I'm guessing if you check the Name attribute on the All tab of the property sheet, it will say CNum. With this being the case, the Iif expression is referring to itself, hence the circular reference error. Probably the easiest way to resolve is to update the Name property to be something like "CNum_Conditional". Really anything other than CNum should work.
Feel free to reach out to info@superaccessninjas.com if you need more guidance.
YES!! I had a lightbulb moment with you said "text box"! I was attempting to add an expression to the field [REQUIRED]...thus getting a circular reference error! I added a clean text box and Voila...it worked!! I am BRAND NEW to Access...I will get this sooner or later! Thank you!
H2H lmk if you need more help 😃😃YES!! I had a lightbulb moment with you said "text box"! I was attempting to add an expression to the field [REQUIRED]...thus getting a circular reference error! I added a clean text box and Voila...it worked!! I am BRAND NEW to Access...I will get this sooner or later! Thank you!
Andre
Info@superaccessninjas.com