B
Brian_M
Hi all,
I've been rummaging around the site a lot in the last few weeks, you guys are
great!
Down to business:
I'm trying to create a MsgBox that will either warn the user that their data
changes weren't saved (likely due to referential integrity violation) or that
it was saved. I have the form all set, and am running the code from the
Submit button. I can make it warn (albeit in a shoddy manner) that the
changes have not saved, but I'm not sure how to go about running a case for
failed/correct entries. Ideally, when the record is updated correctly, the
Msg will say something to the tune of "Changes accepted" or something, just
as a confirmation that all went according to plan.
Here's what I've spliced together so far:
======================
Function Reset_Click()
On Error GoTo Err_Reset_Click
Dim strMsg As String
Dim i As Integer 'This was just because it wanted me to assign the MsgBox
value somewhere
DoCmd.GoToRecord , , acNewRec
Exit_Reset_Click:
Exit Function
Err_Reset_Click:
strMsg = "Your changes were not saved. The most likely cause of this is a
duplicate" & vbNewLine _
& "serial number. Please check your data and try to Submit again."
_
i = MsgBox(strMsg, vbOKOnly, "Changes Failed")
Resume Exit_Reset_Click
End Function
===========================
Thanks for the help!
Brian
I've been rummaging around the site a lot in the last few weeks, you guys are
great!
Down to business:
I'm trying to create a MsgBox that will either warn the user that their data
changes weren't saved (likely due to referential integrity violation) or that
it was saved. I have the form all set, and am running the code from the
Submit button. I can make it warn (albeit in a shoddy manner) that the
changes have not saved, but I'm not sure how to go about running a case for
failed/correct entries. Ideally, when the record is updated correctly, the
Msg will say something to the tune of "Changes accepted" or something, just
as a confirmation that all went according to plan.
Here's what I've spliced together so far:
======================
Function Reset_Click()
On Error GoTo Err_Reset_Click
Dim strMsg As String
Dim i As Integer 'This was just because it wanted me to assign the MsgBox
value somewhere
DoCmd.GoToRecord , , acNewRec
Exit_Reset_Click:
Exit Function
Err_Reset_Click:
strMsg = "Your changes were not saved. The most likely cause of this is a
duplicate" & vbNewLine _
& "serial number. Please check your data and try to Submit again."
_
i = MsgBox(strMsg, vbOKOnly, "Changes Failed")
Resume Exit_Reset_Click
End Function
===========================
Thanks for the help!
Brian