Avatar

Correct answer by
Level 10

Glad we are getting closer

Okay, if you are undertaking a calculation and you want the answer to appear in the tVANo field, it would make sense to have the script in the calculate event of the tVANo field.

Once you have declared and set the values of myYR and myPrj, you can then set the rawValue of the tVANo field by refering to it as "this".

You don't need the myVA variable at all.

So, this in the calculate event of the tVANo field:

var myYR = form1.sfrmMain.Year0.rawValue;

var myPrj = form1.sfrmMain.sfrmMainSub1.sfrmMain2.tbMainInfo.Row2.tPrjNo.rawValue ;


this.rawValue = myPrj.toString() + "-" + myYR.toString();

As I said, you may not need the .toString(), so the script could look like:

var myYR = form1.sfrmMain.Year0.rawValue;
var myPrj = form1.sfrmMain.sfrmMainSub1.sfrmMain2.tbMainInfo.Row2.tPrjNo.rawValue ;


this.rawValue = myPrj + "-" + myYR;

I hope that helps,

Niall

View solution in original post