It is the first X application to run ... I haven't added any others as yet. I'm looking to walk, then run.
Here's my code on form entry
[code] var vCltData as string var vCount as int var vRecord as int var vPdHere as double var vPdDir as double var vPdHereInt as double var vPdDirInt as double var vIntDeferred as int
// Restrict field security by @Group and gray out restricted fields - BW 2005-10-19
if @group = "Users" then { Readonly(DBName,2) RGBColor(DBName,-1,-1,-1,204,204,204) Readonly(DBColl#,2) RGBColor(DBColl#,-1,-1,-1,204,204,204) Readonly(DBTrac#,2) RGBColor(DBTrac#,-1,-1,-1,204,204,204) Readonly(DBLgl#,2) RGBColor(DBLgl#,-1,-1,-1,204,204,204) Readonly(DBComRate,2) RGBColor(DBComRate,-1,-1,-1,204,204,204) Readonly(DBListed,2) RGBColor(DBListed,-1,-1,-1,204,204,204) Readonly(DBList,2) RGBColor(DBList,-1,-1,-1,204,204,204) }
if @group = "Supervisors" or @Group = "Management" then { ReadOnly(DBColl#,0) RGBColor(DBColl#,-1,-1,-1,255,255,255) }
// Pull Up Client Data
if @Mode() = 1 then { vCltData = (@Xlookupsourcelist(@FN, DBCltNo, "Sales Screen!CltNo", "CltName;CltSales;CltInstr;CltIntRate;CltIntDeferred")) if DBClt <> @AccessStringArray(vCltData,1) then DBClt = @AccessStringArray(vCltData,1) if DBSales <> @AccessStringArray(vCltData,2) then DBSales = @AccessstringArray(vCltData,2) if DBCltInstr <> @AccessStringArray(vCltData,3) then DBCltInstr = @AccessStringArray(vCltData,3) if DBIntRate <> @AccessStringArray(vCltData,4) then DBIntRate = @AccessStringArray(vCltData,4) vIntDeferred = @AccessStringArray(vCltData,5) }
// If Interest is deferred, only allow it if the file is over 6 months old
if vIntDeferred = 1 and @date-DBListed < 180 then DBIntRate = 0
// Default unassigned files to Active status
IF @IsBlank(DBQueue) THEN { DBQueue = DBActive }
// Give Total Collected
vRecord = 1
vCount = @FormResultSetTotal("Pmt Data")
if vCount >0 then { While vRecord <= vCount { // Loop through subrecords adding up totals vPdHere = vPdHere + @TM(@FormFieldValue("Pmt Data","PdHere",vRecord)) vPdHereInt = vPdHereInt + (@TM(@FormFieldValue("Pmt Data","PdHere",vRecord))*@Exp(1+DBIntRate,((@date-(@todate(@formFieldValue("Pmt Data","LE0",vRecord))))/365))) vPdDir = vPdDir + @TM(@FormFieldValue("Pmt Data","PdDir",vRecord)) vPdDirInt = vPdDirInt + (@TM(@FormFieldValue("Pmt Data","PdDir",vRecord))*@Exp(1+DBIntRate,((@date-(@todate(@formFieldValue("Pmt Data","LE0",vRecord))))/365))) // vPdDirInt = vPdDirInt + (@TM(@FormFieldValue("Pmt Data","PdDir",vRecord))*@Exp(1+DBIntRate,((@date-DBListed)/365))) vRecord = vRecord +1 } // Place Collected Tally on Form DBPd = vPdHere + vPDDir }
// Work out Balance with interest
DBBal = (DBList * @Exp(1+DBIntRate,((@date-DBListed)/365))) - vPdHereInt - vPdDirInt
ThrowFocus(DBNote0)
Clear(DBNote0) [/code]
|