Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop

Status
Not open for further replies.

Jeremiah31

Programmer
Nov 7, 2006
31
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top