I have a single lingering problem preventing me from moving on with my project. I have a single form with 3 command buttons on it, Delete, Edit, Save&Close.
The form loads as default with:
Me.AllowAdditions = False
Me.AllowEdits = False
Me.AllowDeletions = False
Me.cmdDelete.Visible = False
so the form is proper locked and users can't mess things up.
Edit button works flawlessly:
Opens form in Edit mode at same time changing
Me.AllowAdditions = False
Me.AllowEdits = True
Me.AllowDeletions = True
Me.cmdDelete.Visible = True
Save and Exit then saves and exits as planned.
to delete though i set the visibility of the delete button to false as default.
selecting the edit button reveals the delete button
The delete button brings up the Delete warning i have put in the beforeDelConfirm event as follows:
Private Sub Form_BeforeDelConfirm(Cancel As Integer, _
Response As Integer)
' Suppress default Delete Confirm dialog box.
Response = acDataErrContinue
' Display custom dialog box.(you can replace it with any message you want)
If MsgBox("Are you sure you want to delete this entry?", vbOKCancel) = vbCancel Then
Cancel = True
Me.AllowDeletions = False
Me.AllowEdits = False
Me.AllowAdditions = False
End If
End Sub
Clicking OK to delete works perfectly and the form closes.
Clicking Cancel though works well, resets the form Allows to False
BUT
then when i try to Save&Close the form i get the following message:
Do you want to save the changes to the design of the form "formname"? Y/N/Cancel
I just don't know why, i don't think i've changed the form design at all.
Any help much appreciated.
ndeans
The form loads as default with:
Me.AllowAdditions = False
Me.AllowEdits = False
Me.AllowDeletions = False
Me.cmdDelete.Visible = False
so the form is proper locked and users can't mess things up.
Edit button works flawlessly:
Opens form in Edit mode at same time changing
Me.AllowAdditions = False
Me.AllowEdits = True
Me.AllowDeletions = True
Me.cmdDelete.Visible = True
Save and Exit then saves and exits as planned.
to delete though i set the visibility of the delete button to false as default.
selecting the edit button reveals the delete button
The delete button brings up the Delete warning i have put in the beforeDelConfirm event as follows:
Private Sub Form_BeforeDelConfirm(Cancel As Integer, _
Response As Integer)
' Suppress default Delete Confirm dialog box.
Response = acDataErrContinue
' Display custom dialog box.(you can replace it with any message you want)
If MsgBox("Are you sure you want to delete this entry?", vbOKCancel) = vbCancel Then
Cancel = True
Me.AllowDeletions = False
Me.AllowEdits = False
Me.AllowAdditions = False
End If
End Sub
Clicking OK to delete works perfectly and the form closes.
Clicking Cancel though works well, resets the form Allows to False
BUT
then when i try to Save&Close the form i get the following message:
Do you want to save the changes to the design of the form "formname"? Y/N/Cancel
I just don't know why, i don't think i've changed the form design at all.
Any help much appreciated.
ndeans
Last edited: