Cannot change fields once an amount is entered

J

Jody

I have a form that the figures that are entered into it go into an invoice. I
need the figures to not be able to be changed after an amount is entered into
a field, if any changes need to be made the changes need to go into another
field on the form and then that field cannot be able to be changed. (I hope
this makes sense). I am not sure how to go about doing this. I have tried to
make the field not enabled but it keeps crashing on me.
 
K

Klatuu

I don't know where you are trying to set the enabled property for the
control, but you cannot do it while it has the focus, even in the Lost Focus
event.

One way to accomplish this it to create a hidden text box (Visible = No)
also set Tab Stop = No so it wont confuse the user.

Then in the After Update event of the control you want to disable, set the
focus to the hidden control. In the Got Focus event of the hidden control,
disable the other control, then set the focus to the next control after the
disabled control in the Tab Order sequence.
 
Top