I create a form that has a dropdown box working as a navigate or a search menu in the form header, when a specific item is selected, it will locate and display all the records related with this.
Although I don't have a customer and order database, I'm using something similar with this, so just for example, select a customerID, all the orders of this customer will be displayed
Then I add this form to a tab control.
Everything works fine except everytime I get into the application, the search result always remember last time's search result. I checked the recordsource is to show all records but Don't know somewhere still remember last time's search.
What I want is whenever get into the application, all the orders will be shown.
Tried that too, but it seems still not fix the problem. when reopen, it still displays last search result
I think what may cause the problem is that I add the form to a tab form.
If I use the form itself there is no such problem.
I also experiment to just add the form as a subfrom to a main form.
It has the same problem.
So you are creating a new sub form with the query results? If that's the case, then you are saving the form at some point. It's probably in the code, but may be set to automatically save without asking as well.
The only way for the displayed results to change when you reopen the form is is the underlying query changed or the form changed (and was saved).
Make sure to include the acSaveNo constant in the form close action.
Perhaps if you could create a sample DB with just the form in questio and some dummy data so we can check it out.