I've looked, and not found much. I have a text field in a form named [myLocation], which acquires its data through a control source of =getLocation()
the getLocation() function returns a DLookup, which changes based on some other field of that record.
Now, I would like the form footer to count the two different locations that may occur. So, naturally I tried:
=Count(IIf([myLocation]="Home",0))
This not only returns #Error on that field, but every other (otherwise working) counting field in the footer. Same thing happens even if I just count([myLocation]). Clearly there's something that I wasn't told. I half-expect a group of my techie friends to pop out of somewhere laughing at me cuz they purposely removed a page from my reference book or something. Any help is greatly appreciated.
Oh and a secondary issue: is there some easy way to count unique field values in a filtered form whose filtered criteria is constantly being changed from the form? (I expect the answer is "no, there is no easy way" - that's fine, just need to know).
All help is always apreciated.
Your question isn't really clear. Are there more than one fields that you're counting?
You can try using your form's On_Current event to put a value in your count field
If me.MyTextbox = 'somevalue' Then me.MyFooterTextbox = 1
also, wouldn't your syntax be a bit different with the IIF function anyway?
=IIf([mytextbox]="Home",1,0)
But again, if you have a single view form, wouldn't your count always be 1 or 0?