G
Gel
When I close a form even though it hasn't been dirtied
yet - the message box pops up. I only want it to appear
if a new record is created or Me.dirty = true.
Code in close command button:
If Me.Dirty = False And Me.NewRecord = False Then
DoCmd.CLOSE
Else
If Me.NewRecord = True Or Me.Dirty = True Then
If MsgBox("Do you want to save the change?",
vbYesNo, "Test DB") = vbYes Then
Call cmdSave_Click
Else
Me.Undo
DoCmd.CLOSE
Exit Sub
End If
Else
DoCmd.CLOSE
Exit Sub
End If
End If
Pls. help. Thanks for any advice!!!!
yet - the message box pops up. I only want it to appear
if a new record is created or Me.dirty = true.
Code in close command button:
If Me.Dirty = False And Me.NewRecord = False Then
DoCmd.CLOSE
Else
If Me.NewRecord = True Or Me.Dirty = True Then
If MsgBox("Do you want to save the change?",
vbYesNo, "Test DB") = vbYes Then
Call cmdSave_Click
Else
Me.Undo
DoCmd.CLOSE
Exit Sub
End If
Else
DoCmd.CLOSE
Exit Sub
End If
End If
Pls. help. Thanks for any advice!!!!