I know this is not a new topic but previous posts don't seem to help ...
I have a navigation subform in Access 2010. When you click on a tab in the navigation subform ("NavigationSubform"), it displays another form ("Form1") and its subform ("Subform1"). I change the recordsource of Subform1 programatically based on various combobox values using VBA as follows:
Forms!frmMain!NavigationSubform!ContainerForm1.For m.RecordSource = "SELECT * FROM yada yada ... "
Forms!frmMain!NavigationSubform!ContainerForm1.For m.Requery
That part works fine. However, I have a double click event in one of the text box controls in Subform1 that causes the focus to move to another tab in the navigation subform. I use the following code to achieve this:
DoCmd.BrowseTo acBrowseToForm, "Form2", "frmMain.NavigationSubform"
When the user double clicks on this field, he gets a "Do you want to save changes to the design of 'Subform1'" prompt. I assume that assigning a new recordsource to the subform is the "change" it's referring to.
How can I stop this annoying message?
I tried putting the "DoCmd.Close acForm, Me.Name, AcSaveNo" statement in the close event of Subform1, but then I get a surprising error (to me) that claims that Subform1 is not open. What else can I do?