I am trying to figure out how to display an image on a form based on a list-box selection. I am only working with about 8 different images. I want to display an image of a cpu when "cpu" is selected, an image of a printer when "printer" is selected, etc. I created a table and embedded...
HasData only performs the expression if there are records returned when you run the report. I don't know where HasData originates from - I saw it in Access samples on the web. I created a report that has the students names, id #, campus etc. and then has a "Y" under the appropriate...
correction - the above code did not properly give a "0" if there were no records that met the criteria.
=IIf([HasData],Count(IIf([ESY ENG] Or [ESY LANG]="-1","0")),"0")
I was able to figure it out - I was somehow combining two sums incorrectly - so I used this:
=IIf([HasData],Count(IIf([ESY ENG] Or [ESY LANG]="-1","0")))
This way I only count the record once.
The simplified expression that GingerR gave me works great. I have already switched it for all the ESY*** fields. But I still get the same error when working with the ESY LANG field. There are several ESY*** fields and I only have a problem with the ESY LANG field - and only when it...
This works great:
=IIf([HasData],IIf([ESY MATH]="-1","Y") & IIf([ESY MATH]="",""))
This line just puts a Y if there is a -1 in the ESY MATH
field and nothing if there is not.
However, this does not work - I get the data type mismatch in criterial expression #3464...
My false does appear as a 0 in the underlying table. And when I tried to switch the type of the field to Yes/No, it behaved the same. So, it appears that No and false = 0. Could the problem be related to the fact that I have a built-in query that only produces records if the field equals -1...
I have done some more experimenting. I was incorrect, the sum or the count does not work if there are 0s. There has to be at least one record with a -1. I have tried switching the field to a Yes/No field - with the same results it only works if there is at least one record with a Yes. ????
That is interesting - I could set the field to 0 with a default value but I think that would only take care of any new records. Is there an easy way to set [ESY READ] value for all existing records to 0?
#Error message when adding items with a 0 or -1.
I have fields that are generated with a checkbox which results in a -1 in the underlying table if it the box is checked and a 0 if it was checked at one time and then is unchecked. However, I cleared out all entries in some of the fields -...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.