I wonder When else statement Execute which is vbNo the form will disappear and cmdsave does not setfocus. Can anyone tell me why?
VB Code:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) If Response = vbYes Then FormMain.Show Else cmdSave.SetFocus End If End Sub
