if i change a value there should be a text box. and if you press yes, for example, the value changes and if you press no, the old value remains. how to do this
if i change a value there should be a text box. and if you press yes, for example, the value changes and if you press no, the old value remains. how to do this
I think a clearer description o what you have, what you need, and a little more detail would be useful.
Perhaps even a copy of your db.
..."if i change a value there should be a text box" a value where?
..."and if you press yes, for example, the value changes" what/where is the "Yes" and what "value" changes?
as you can see in the image below I have few different values. Location, amount and min amount should not be accidentally changed. therefore if you want to change this value there should be a text box with do you want to change this value yes or no. if you choose yes, the value of, for example, location must change. if you choose no, the old value will remain. hopefully it's a bit clearer now
Private Form_BeforeUpdate(Cancel As Integer)
Cancel = (Msgbox("Do you want to save changes?", vbYesNo+vbQuestion) = vbNo)
If Cancel Then Me.Undo
End Sub
You could use code, similar to that which arnelgp has given you, in the BeforeUpdate event of "amount" and "min amount" which would enable to give a more detailed warning to the user about what values are about to be altered.