I have a complex application with an order form for viewing an existing customer's orders and initiating new orders. While viewing one order I can opt to open a new order. I used to Close the form and then reopen it with the new order number as part of the "New Order" procedure. This caused a slight delay due to the complexity of the form. Then I tried skipping the "Close" and just reopen the form with the new order number. Worked like a charm. This action appears to update the current record and then open the new one which runs the "Form_Current" procedure but not the "Form_Open" or "Form_Load". To be certain that the current record is updated I do a "Me.Dirty = False" before the Docmd.Openform.
Then I thought that using "Me.RecordSource = "SELECT * FROM etc. WHERE OrderNum =" & varorder
would be better somehow. I tried it in a couple of places (procedures that do a "Next" and "Previous" to step through the current orders) but not in the "New Order" procedure just as an experiment. Worked just fine, but not a lot faster, for the "Next" and "Previous" procedures. But when I clicked on "New Order" I had a completely blank form!! It's as if the "DoCmd.Openform etc. OrderNum =" & neworder did not get the record!!
I watched the "Me.RecordSource" go through "Form_Current" just like a "DoCmd.Openform so it looked like it was doing the same thing. But there is obviously a subtle difference that eludes me. It's like the recordset for the form has been forgotten. But how? And if so, how to get it back?
Just curious, because I went back to the "DoCmd.Openform" in all places and it works fine.