'do you want to save changes to the design of the form
I have developed a Microsoft access 2010 database that uses navigation subforms nested a couple layers deep. When the user clicks on navigation tabs to change the form displayed in the subform (sourceobject), a dialog box appears asking the user:
"Do you want to save changes to the design of the form 'form name'?"
This is obviously unacceptable in a deployed database. Can someone please explain how to get rid of this behavior, so that users can use the navigation tabs without being asked if they want to change design of the form?
I have already programmed logic allowing users to decide whether or not to save data changes. I do not want the user to be prompted about design changes.
Solution 1:[1]
The only thing I've been able to get to work is to turn warnings off in the OnEnter event for each navigation button, and turn them back on in each 'sub' form's Open event - e.g.
Private Sub navbtnDetails_Enter()
DoCmd.SetWarnings False
End Sub
and
Private Sub Form_Open(Cancel As Integer)
DoCmd.SetWarnings True
End Sub
This should be the Open event, rather than the Load event, because the Load event occurs after the form's data is loaded.
One benefit of this approach is that it persists changes to any datasheets - column widths, sorting, etc., though that may or may not be a good thing, depending on how you need the UI to work.
This is with Access 2013.
Solution 2:[2]
I know this is an old question, but this solution may help others:
Manually: uncheck "Enable design changes in Datasheet view" in File, Option, Current Database.
Programmatically: CurrentDb.Properties("AllowDatasheetSchema") = false
This is one of the best practices before deployment in: MS Access Developer Center however, this change prevents editing tables in datasheet view, so I suggest adding it in a function and calling it on/off as needed.
Public Function SetDesignChange(chnage As Boolean)
CurrentDb.Properties("AllowDatasheetSchema") = change
End Function
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Brian Burns |
| Solution 2 | khosrow khazraei |
