Field value in dialog box not correct

Hello there.I have a dialog box that is displayed using @DialogBox.

On the form in the dialogbox, I have a field that is set with a flag in the form’s queryclose.

This flag determines whether the dialogbox should be displayed again or whether it is ok to continue.

My problem is that the queryclose sets the field correctly but when the dialogbox closes, the value in the flag is lost.

retdlg := “1”;

flag := “0”;

@While(

retdlg = “1” & flag != “1” ;

retdlg := @Text(@DialogBox(“MyForm” ; [AutoHorzFit] : [AutoVertFit]));

@Prompt([Ok];“retdlg”;retdlg);

@Prompt([Ok];“flag”;flag);

@If(retdlg = “1” & flag != “1”;@Prompt([Ok];“”;“dialog will be displayed again”);“”)

);

retdlg is the return from the dialogbox(whether ok or cancel is clicked)

I have put a msgbox in the form’s queryclose and the flag is correctly set, but in the @prompt, it is empty.

…the weird thing is that if I set the flag’s value manually in the dialogbox, it gets changed by the queryclose but the value I entered appears in the @prompt

Subject: field value in dialog box not correct

I’m not sure I fully understand what flag field you are setting in QueryClose using what code, but according to designer help, @DialogBox does not have a return value. So, even if you do get one now, you might not with the next release.

Subject: RE: field value in dialog box not correct

Thanks…the return from the @dialogbox seems to work fine. I get “1” if the user clicks OK and “0” if the user clicks cancel.

Anyway I’m not using it anymore: I have got around the problem by using an agent with workspace.Dialogbox. I’m getting a return value and field values correctly now