Jeremiah31
Programmer
I never had to create a loop function before. My goal is to perform a validation if cost is greater than retail, prompt a warning message. I'm trying to figure out how to make it a soft error. Just to warn the user, if cost is suppose to be greater retail then the user will select yes, and nothing will happen.
Private Sub CurRetail_AfterUpdate()
Dim Strmessage As String
Dim intOptions As Integer
Dim bytChoice As Byte
If (Me.CurCost) > (Me.CurRetail) Then
Strmessage = "Cost is greater than retail. Is this correct?."
intOptions = vbYesNo
bytChoice = MsgBox(Strmessage, intOptions)
If bytChoice = vbNo Then
Me.CurCost.SetFocus
Me.CurCost = Null
End If
End If
Private Sub CurRetail_AfterUpdate()
Dim Strmessage As String
Dim intOptions As Integer
Dim bytChoice As Byte
If (Me.CurCost) > (Me.CurRetail) Then
Strmessage = "Cost is greater than retail. Is this correct?."
intOptions = vbYesNo
bytChoice = MsgBox(Strmessage, intOptions)
If bytChoice = vbNo Then
Me.CurCost.SetFocus
Me.CurCost = Null
End If
End If