i want to add a code to ask people to save it or not after they update their form or subform..
I use the following code:
__________________________________________________ ___
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strResponse As String
If Me.Dirty Then
Select Case MsgBox( _
Prompt:="Data have updated" & _
vbCrLf & "Sure to save it?", _
Buttons:=vbExclamation Or vbYesNo)
Case vbYes
DoCmd.RunCommand acCmdSave
Case vbNo
DoCmd.RunCommand acCmdUndo
End Select
End If
End Sub
______________________________________________
Private Sub Save_Click()
FormDirty = False
DoCmd.RunCommand acCmdSave
End Sub
______________________________________________
But it only works on the main form, but ignore the update of subform.
what should I add in odder to have a effect on subform also??
I use the following code:
__________________________________________________ ___
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strResponse As String
If Me.Dirty Then
Select Case MsgBox( _
Prompt:="Data have updated" & _
vbCrLf & "Sure to save it?", _
Buttons:=vbExclamation Or vbYesNo)
Case vbYes
DoCmd.RunCommand acCmdSave
Case vbNo
DoCmd.RunCommand acCmdUndo
End Select
End If
End Sub
______________________________________________
Private Sub Save_Click()
FormDirty = False
DoCmd.RunCommand acCmdSave
End Sub
______________________________________________
But it only works on the main form, but ignore the update of subform.
what should I add in odder to have a effect on subform also??