Kbase P106631: Error 3140 trying to dynamically change format of field in FORM HEADER
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/1/2005 |
|
Status: Unverified
SYMPTOM(s):
Error trying to dynamically change the format of a field in FORM HEADER
Cannot access FORM value because widget doesn't exist (3140)
This can happen with the following example code:
def var w-number as int format "zz".
def var w-format as char.
assign w-number = 99
w-format = "zzzz".
form header
"test print" skip
"Number:" w-number skip (1)
with page-top no-box no-labels frame h1 width 60.
w-number:format in frame h1 = w-format.
w-number = 8888.
display w-number with frame h1.
CAUSE:
This is expected behaviour. Once the FORM HEADER has been defined it is not possible to afterwards change the format of a field.
FIX:
Although this is expected behaviour, there are some ways to workaround this issue.
I.e: Define a different format within the FORM HEADER statement and redisplay the frame:
def var w-number as int format "zz".
def var w-format as char.
assign w-number = 99
w-format = "zzzz".
form header
"test print" skip
"Number:" w-number format "zzzz" skip (1)
with page-top no-box no-labels frame h1 width 60.
display w-number with frame h1.
hide frame h1.
w-number:format in frame h1 = w-format.
w-number = 8888.
display w-number with frame h1.