Fro some reason this code will not work where I have it. it is just a message box with yesno and when yes is no is clicked I want it to exit the sub. Am i missing something:

Dim iAnswer As Integer

MsgBox "Did You Save Your New Changes?", vbYesNo + vbInformation, "Close Inventory History Page"
If iAnswer = vbno Then
Cancel = True
Exit Sub
End If