RunDialog problem: Editing DB Info with a Dialog

I am trying to use for the first time the option of editing database info with a rundialog, which is described in detail on the Rundialog help page. But I keep getting an error message that looks to me like it must be in the PanX code, not my code. Here is my rundialog code:

 loop
     rundialog {Form=MarkGroupPaid Height=150 Width=550 sheet=true
         variabletype=fileglobal
         Variable: "dCheckNo=«Check.No»"
         Variable: "date(«dCheckDate»)=datepattern(«Check.Date»,"MM/DD/YY")"
 }
     stoploopif info("trigger")="Dialog.Close"
 endloop

When I run this the dialog does not open and instead I get the error message:

Execute code contains syntax error: Expression contains a comma when an operand was expected

When I remove the two Variable: lines, the dialog opens and functions okay. I don’t think that my one and only comma, in the datepattern function, is the one causing a problem. Any help with this problem would be appreciated.

The problem appears to be the quotes within quotes in this line. You need to use a different type of quote to quote the date pattern than you use to quote the expression as a whole. You might try

Variable: "date(«dCheckDate»)=datepattern(«Check.Date»,“MM/DD/YY”)"

I’m using smart quotes to quote the date pattern.

1 Like