I placed this code in the before event property for most of my forms. Before i close the form this code prompts whether you wish to save the new record.
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim Msg, Style, Title, MyString, Response
If Not Confirm Then
Beep
Msg = "Do you wish to save this data?"
Style = vbYesNo + vbExclamation + vbDefaultButton1
Title = "Confirm data entry"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
Else
Me.Undo
End If
End If
End Sub
The problem is it only works for one of my forms and not the rest
Why is that?
any solutions to fixing it
THANK YOU
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim Msg, Style, Title, MyString, Response
If Not Confirm Then
Beep
Msg = "Do you wish to save this data?"
Style = vbYesNo + vbExclamation + vbDefaultButton1
Title = "Confirm data entry"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
Else
Me.Undo
End If
End If
End Sub
The problem is it only works for one of my forms and not the rest
Why is that?
any solutions to fixing it
THANK YOU