I'm attaching a super simple file demonstrating what I think may be a bug. Wouldn't surprise me if everyone knew but me.
Open Form 1: press the button to launch DoCmd.OpenForm "Form2".... Where clause opens where [ID]=2
Form2_Load fires: Msgbox me![field1]
Everything works just fine. Form 2 correctly loaded via the filter and the Messagebox reflects that.
Now, go into the code module for Form2 and change ANYTHING. maybe add a comment or something. Now rerun this experiment starting in Form1. You'll notice that while Form2 loads up filtered correctly, the msgbox returns unfiltered data from the first record in the table. close the form and try again and everything works fine. The bug only procs the first time running after a code module change on the called form.
am I missing something?
Note: I discovered part of the reason - When the glitch occurs as a result of the code module aleration above, the visual Form will appear to have its .FilterOn = True as it should be, but it's actually still false when the MsgBox is firing. Only after the Form is visibly displayed does Access get its act together and apply the filter. So the _Load event is still playing with unfiltered data.
mattDatabase201.accdb