I have a user From with 6 input boxes. One of those receives a strike price. If that price is lower than a the purchase price I want to tell the operator and then depending on the response move the focus back to the purchase price text box. This is th code
Private Sub Opt5_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Opt5.Value < Opt2.Value Then
Response = MsgBox("The Strike Prices is lower than the Purchase Price is this correct", vbYesNo, "Check Strike Price")
If Response = vbNo Then
Opt2.SetFocus
Cancel = True
Exit Sub
End If
End If
End Sub
For some reason it asks the question twice even if I click No the first time and then I get an error at the Opt2.Setfocus command.
This is the error message
40018-Screen-Shot-2015-03-28-at-12.37.06-PM
Any suggestions as to the solution greatly appreciated I have searched on line about moving the focus without any luck.
Thanks
Peter