D
deb
On the code below I am getting the error message "Variable not defined" and
it highlights "Msg" in the code. What am I doing wrong
Private Sub btnDelProj_Click()
On Error GoTo Err_btnDelProj_Click
Me.AllowEdits = True
Me.AllowDeletions = True
Me.AllowAdditions = True
Msg = "Are you sure you want to delete this Project?" _
& vbCr & vbCr & "This will delete the entire Project record and data
associated with this project."
ans = MsgBox(Msg, vbYesNo)
If ans = vbNo Then
MsgBox "The Project has NOT been deleted."
Exit Sub
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.GoToRecord , , acNewRec
End If
Exit_btnDelProj_Click:
Exit Sub
Err_btnDelProj_Click:
MsgBox Err.Description
Resume Exit_btnDelProj_Click
End Sub
it highlights "Msg" in the code. What am I doing wrong
Private Sub btnDelProj_Click()
On Error GoTo Err_btnDelProj_Click
Me.AllowEdits = True
Me.AllowDeletions = True
Me.AllowAdditions = True
Msg = "Are you sure you want to delete this Project?" _
& vbCr & vbCr & "This will delete the entire Project record and data
associated with this project."
ans = MsgBox(Msg, vbYesNo)
If ans = vbNo Then
MsgBox "The Project has NOT been deleted."
Exit Sub
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.GoToRecord , , acNewRec
End If
Exit_btnDelProj_Click:
Exit Sub
Err_btnDelProj_Click:
MsgBox Err.Description
Resume Exit_btnDelProj_Click
End Sub