In saying that, the previous line of code is 'If Me.Dirty Then Me.Dirty = False' as you've previously asking to me do. Should I remove this and run it again?
Got the code as follow:
Code:
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
If Me.Dirty Then Me.Dirty = False
MsgBox "This is me dirty:" & Me.Dirty
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
Exit_cmdSave_Click:
Exit Sub
Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub
I don't believe that this has been asked/answered; do the ADP and ADE files both reside in the same Folder when you are testing them? Since the Me.Dirty is returning True, before you try to save the Record, it sounds as if you do not have the needed Permissions, from the ADE file, to Write to the Back End file.
You could try a different tack and get the DoCmd.Close to do the save for you, that way you shouldn't need DoCmd.SaveRecord at all.
Code:
Private Sub cmdSave_Click()
On Error GoTo Err_cmdSave_Click
DoCmd.Close acForm, [B]Me.Name, acSaveYes[/B]
Exit_cmdSave_Click:
Exit Sub
Err_cmdSave_Click:
MsgBox Err.Description
Resume Exit_cmdSave_Click
End Sub
Just point out that the acSaveYes option has no effect on your records. It saves design changes to the form which is equivalent to the acCmdSave constant you had in your original post.
Obviously being an ADE, acSaveYes will have no effect on the project.