I'm putting together a quick function to validate the entry of the current control on a form. Everyting is fine, except when I choose the No option in the messagebox, no matter what I seem to do it moves to the next control on the form. I want to stay in the current control and let the user input something else.
Thanks for your help, Kopy.
Here's my code:
===========================================================
Function ValidateEntry()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you really want to input " & Screen.ActiveControl.Value & " ?"
Style = vbYesNo
Title = "Data Entry Validation"
If Screen.ActiveControl.Value >= 35 Then
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
MyString = "Yes"
Else
MyString = "No"
Screen.ActiveControl.Value = 0
Screen.ActiveControl.SetFocus
End If
End If
End Function
Thanks for your help, Kopy.
Here's my code:
===========================================================
Function ValidateEntry()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
Msg = "Do you really want to input " & Screen.ActiveControl.Value & " ?"
Style = vbYesNo
Title = "Data Entry Validation"
If Screen.ActiveControl.Value >= 35 Then
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
MyString = "Yes"
Else
MyString = "No"
Screen.ActiveControl.Value = 0
Screen.ActiveControl.SetFocus
End If
End If
End Function