S
shiro
I have code that doesn't work in case vbNo and don't know why.
Please help.The code works on form BeforeUpdate even but not on
my command button click even.Any guidance would be greatly appreciated
Thank's
Private Sub AddSpec_cmd_Click()
On Error GoTo Err_AddSpec_cmd_Click
Dim strMessage As String
Dim intResponse As Integer
intResponse = MsgBox("Is the spec correct?", vbYesNoCancel, "Confirm")
Select Case intResponse
Case vbYes
If IsNull(Me.Model) Then
strMessage = strMessage & _
" Enter Model Name" & vbCrLf
End If
If InputVoltage.Value < 11 Then
strMessage = strMessage & _
" Input correct voltage rate " & vbCrLf
End If
If Len(strMessage) = 0 Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
Else
MsgBox strMessage, vbOKOnly, "Error"
End If
Case vbNo
If MsgBox("Delete data?", vbOKCancel, "Confirm") = vbOK Then
Me.Undo
End If
Case vbCancel
Cancel = True
End Select
Exit_AddSpec_cmd_Click:
Exit Sub
Err_AddSpec_cmd_Click:
MsgBox Err.Description
Resume Exit_AddSpec_cmd_Click:
End Sub
Please help.The code works on form BeforeUpdate even but not on
my command button click even.Any guidance would be greatly appreciated
Thank's
Private Sub AddSpec_cmd_Click()
On Error GoTo Err_AddSpec_cmd_Click
Dim strMessage As String
Dim intResponse As Integer
intResponse = MsgBox("Is the spec correct?", vbYesNoCancel, "Confirm")
Select Case intResponse
Case vbYes
If IsNull(Me.Model) Then
strMessage = strMessage & _
" Enter Model Name" & vbCrLf
End If
If InputVoltage.Value < 11 Then
strMessage = strMessage & _
" Input correct voltage rate " & vbCrLf
End If
If Len(strMessage) = 0 Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
Else
MsgBox strMessage, vbOKOnly, "Error"
End If
Case vbNo
If MsgBox("Delete data?", vbOKCancel, "Confirm") = vbOK Then
Me.Undo
End If
Case vbCancel
Cancel = True
End Select
Exit_AddSpec_cmd_Click:
Exit Sub
Err_AddSpec_cmd_Click:
MsgBox Err.Description
Resume Exit_AddSpec_cmd_Click:
End Sub