Questo?
codice:
dim alert as VbMsgBoxResult
if txtnome<>nomevar then
alert=msgbox("Vuoi salvere le modifiche?",vbyesno)
if alert=vbyes then
...
else
.....
end if
end if