ms-accesssubform

Subform doesn't recognize textbox source after reopening file


I have one main form with a subform and two date text boxes. The subform has been connected to the query with a date value column. I put criteria in query Between [Forms]![frm_mainform]![txt_from] And [Forms]![frm_mainform]![txt_to]. Also, both text boxes have Default Value set as =DateAdd("d";-30;Date()) and =DateAdd("d";30;Date()).

So, it works fine until I close the document and reopen it. After that subform doesn't recognize text boxes and lanch me entry boxes for both values.

Data entry form pic

After I change just one letter in Name it works again, and when I close the document again it lost it again.

Is anyone familiar with this behavior?


Solution

  • I have put Me.Refresh on Form_Load() event and it fixed it.

    Still, I don't know what causes such behavior.