MS ACCESS "Save changes to the design of query"?
Hi
Got a real head banger case here!
I have one subform with a query as it's source object on a main form. When I open and close the main form without making any changes, Access still asks me:
"Do you want to save changes to the design of query 'qryFinalAmendments'?"
A command button on the main form is clicked and the event has the following code:
VB Code:
Private Sub cmdCloseAmendments_Click()
On Error GoTo Err_cmdCloseAmendments_Click
DoCmd.Close acForm, "frmAmendments", acSaveNo
DoCmd.OpenForm "Switchboard", acNormal
Exit_cmdCloseAmendments_Click:
Exit Sub
Err_cmdCloseAmendments_Click:
MsgBox Err.Description
Resume Exit_cmdCloseAmendments_Click
End Sub
The Form close event has no code. Can anyone tell me why I would be getting this message asking me if I would like to save changes that have not been made?
Is there a way that I can stop this message appearing - I have already tried using "DoCmd.SetWarnings False" but this doesn't stop the message being displayed?
Thanks
Pobo
Re: MS ACCESS "Save changes to the design of query"?
is this the subform:
DoCmd.Close acForm, "frmAmendments", acSaveNo
Re: MS ACCESS "Save changes to the design of query"?
no.. thats to close itself (the form with a subform in it) right??
Re: MS ACCESS "Save changes to the design of query"?
Try switching the order.
VB Code:
DoCmd.OpenForm "Switchboard", acNormal
DoCmd.Close acForm, "frmAmendments", acSaveNo
Re: MS ACCESS "Save changes to the design of query"?
Access is annoying in the way that it asks if you want to save things. Excel too. You can try DoCmd.SetWarnings False before code, setting back to True after the code runs. You can also set this as a general option for your install of Access in Tools > Options to work on all dbs. But there are some warnings this doesn't work for.
Gotta take girls to karate, can't elaborate right now, hope this helps.
Re: MS ACCESS "Save changes to the design of query"?
Note that SetWarnings and DisplayAlerts only take the default choice of the msgbox. If the default is acceptable then that should be ok.