I'm at a complete loss, a form just changed behavior on me; it was working and then just stopped for no apparent reason. I'm opening it from a button:
DoCmd.openForm "formName", , , "ID=" & Me.ID
Debug tracing shows that the value is set properly at this point. When the form loads, I need to set a few display items, using the OnCurrent event.
Private sub Form_Current()
if Me.NewRecord Then
At that point, it says there's no record, debugging info says the recordset is BOF and EOF, as if the query didn't match. But if I run the saved query at that moment, it displays the right info. Furthermore, if I stop the execution, leaving the form open, and then hit the button again, it does load the data properly. I'm stumped.
Edit - After importing the form from a backup, and retyping the changes, the whole problem went away. I'm guessing corruption, but it's a mystery how it can screw up like that.