Update Field!

nvermanverma Member Posts: 396
Hey guyz,

I am in a bit of a dilema. I have been looking through this form for hours but still havent been able to figure it out.

I have a form with a field called employee (which is off type boolean) and a field called "employee No." (is of type text).

If I click the Employee field then only I want it to show employee no. as an editable field. However, if the employee field is unchecked, i want it to update the 'employee no.' field by making it un-editable.

I have part of this working. But it doesnt update my fields right away. I have to close the form and run it again for it to update my field. which is sorta pointless.

I have this code in OnOpenForm trigger and OnAfterGetRecord.
IF Employee = FALSE THEN
   BEGIN
      CurrForm."Employee No.".Editable(FALSE);
      CurrForm."Employee No.".ENABLED(FALSE);
   END
ELSE
      CurrForm."Employee No.".Editable(true);
      CurrForm."Employee No.".enabled(true);

So if employee is checked, i want it update the record and make "employee No." editable and enabled right away.

Thanks

Comments

Sign In or Register to comment.