=DLookup() and =Sum() not working (and they used to!)
Posted on 2013-11-22
I have a datasheet as a subform. It has currency values in one field called EP.
In the footer is a field TtlEP with the control source =Sum([EP])
The parent form has a text box that has the control source =[Subformname]![TtlEP]
Worked perfectly last week, and has for months. I'm now doing some finally editing on visual aspects (like colour), and noticed the parent form total field is blank.
I've tried refreshing, requerying (with VBA) on both the subform and then the parent form. I even tried setting the ControlSource via VBA. No go. The only thing that works is if I press F9 OR if I set a requery method on a doubleclick within the field.
On another form, there's a text box that has a controlsource of DLookup("[NewYr]","qryYrs") qryYrs has one field, is grouped, and the one field is set to max. This gives me the MaxCDYr, which is what I want - the largest year number in the table (4 records). The query is fine. The field no longer populates when the form is opened, but it used to. Again, I have to press F9 to get the field to populate.
Oh, and I even checked the references (although I may have missed one), did a repair/compact, ran the Linked Table Manager. No go.
BTW: it's an Access 2013 desktop database, split into FE and BE, both MSA2M13. I swear, it used to populate all the fields without having to do any code, requery, whatever. And there are no error messages or codes - just blank fields.
Any ideas, anyone?