E
EdS
Hello.. I have a command button to close a form which checks that a field
(VOL1) is greater than one. For some reason, I am being prompted twice to
save the record. Can anyone solve this for me?
Here is the code:
Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click
Dim intResponse As Integer
intResponse = MsgBox("Save New Record?", vbYesNo)
Select Case intResponse
Case vbYes
If (VOL1) >= 1 Then
DoCmd.Close
Else
MsgBox ("VOL 1 Must be at least one.")
Me.VOL1.SetFocus
End If
Case vbNo
Me.Undo
DoCmd.Close
End Select
Exit_cmdExit_Click:
Exit Sub
Err_cmdExit_Click:
MsgBox Err.Description
Resume Exit_cmdExit_Click
End Sub
(VOL1) is greater than one. For some reason, I am being prompted twice to
save the record. Can anyone solve this for me?
Here is the code:
Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click
Dim intResponse As Integer
intResponse = MsgBox("Save New Record?", vbYesNo)
Select Case intResponse
Case vbYes
If (VOL1) >= 1 Then
DoCmd.Close
Else
MsgBox ("VOL 1 Must be at least one.")
Me.VOL1.SetFocus
End If
Case vbNo
Me.Undo
DoCmd.Close
End Select
Exit_cmdExit_Click:
Exit Sub
Err_cmdExit_Click:
MsgBox Err.Description
Resume Exit_cmdExit_Click
End Sub