Tony McGuire wrote:
Quote:
What code is on the form? |
Howdy Tony.
Code on form (escrTrans.fsl) follows. Form called from open not
openAsDialog.
Thanks for assisting.
Rey
;|BeginMethod|#FormData1|Var|
Var
frmUnit form ; open MastUnit form
strUnit string ; unitnum
uiUnitNum uiobject ; unitnumPK field on MastUnit form
lDone logical ; rpt data obtained
endVar
;|EndMethod|#FormData1|Var|
;|BeginMethod|#FormData1|init|
method init(var eventInfo Event)
; attach to Unit Master (MastUnit)
; get unitnum
IF NOT frmUnit.attach("Unit Master") THEN
errorshow("Unable to attach to Unit Master form", "Press >> button
if displayed")
msgInfo("","Unable to attach to Unit Master form")
RETURN
endIF
txtUnit.edit()
txtUnit.blank()
; get unit number
uiUnitNum.attach(frmUnit.unitnumpk)
strUnit = uiUnitNum.value
txtUnit.value = uiUnitNum.value
endMethod
;|EndMethod|#FormData1|init|
;|BeginMethod|#Page2|open|
method open(var eventInfo Event)
; place tableframe into edit mode so user can click on Match
column...
escrFees.edit()
if escrfees.isedit() then
message("escrFees UIObject in edit mode")
; msginfo("","escrFees UIObject in edit mode")
endIF
lDone = false ; flag for what to return to calling form
endMethod
;|EndMethod|#Page2|open|
;|BeginMethod|#Page2.btnAdd|pushButton|
method pushButton(var eventInfo Event)
{
insert new record
currently unable to move to end of table and do so
even with autoappend true and autofit false
getting to be pain...
}
var
uifees uiObject
tc tcursor
endvar
escrFees.edit()
; attach tcursor to uiobject
tc.attach(escrFees)
tc.edit()
tc.end()
tc.insertAfterRecord()
tc.description = " "
uiFees.attach("escrFees")
uiFees.action(dataEnd)
;uiFees.insertAfterRecord()
uiFees.forcerefresh()
uiFees.UnitNum.MoveTo()
if tc.isassigned() then
tc.close()
endIF
endMethod
;|EndMethod|#Page2.btnAdd|pushButton|
;|BeginMethod|#Page2.btnCancel|pushButton|
method pushButton(var eventInfo Event)
; form closed by calling form MastUnit
formReturn("Cancel")
endMethod
;|EndMethod|#Page2.btnCancel|pushButton|
;|BeginMethod|#Page2.btnTrans|pushButton|
method pushButton(var eventInfo Event)
; get matched escrow fees and those that are unposted
VAR
sqlPosted SQL
sqlUnPosted SQL
dbPriv database
uiFees uiObject ; escrFees table frame
uiMatched uiObject ; matched ui object
frmSelf form ; this form
siChecked smallint ; # check boxes checked
liNumRecs longint ; # records in table frame
x longint ; counter
tbl table
arTables Array[2] string ; hold tables being indexed
endVAR
siChecked = 0
liNumRecs = 0
frmSelf.attach()
uiFees.attach(frmSelf.EscrFees)
liNumRecs = uiFees.nRecords()
uiFees.home() ; go to 1st record
; now loop/move thru tblframe records seeing which records are
checked
FOR X FROM 1 TO liNumRecs
if uiFees.Posted.value = "P" then
siChecked = siChecked + 1
endIF
uiFees.nextRecord()
endFor
; info user if nothing checked
IF siChecked = 0 THEN
IF msgQuestion("", "You did NOT match any escrow fees." + "\n"
+ "Is this correct?") = "Yes" THEN
; lDone = false ; flag for what to return to calling form
btnExit.moveto()
RETURN
ELSE
uiFees.moveto()
uiFees.home()
RETURN
endIF
endIF
IF NOT dbPriv.open("

riv:") THEN
errorshow("", "Click >> button if displayed")
msgstop("","Unable to access private directory to run querys." +
"\n"
+ "Notify Systems Adminstration")
RETURN
endIF
sqlPosted = SQL
select unitnum,
itemcode,
description,
prepaid,
amount
from escrfees
where Posted = 'P'
order by ItemCode
endSQL
sqlPosted.writeSQL("

riv:sqlPosted.txt")
IF NOT sqlPosted.executeSQL(dbPriv, "

riv:FeesPosted.db") THEN
errorshow("Unable to run Posted Fees query", "Click >> if
displayed")
msgstop("Query Problem", "Unable to run Posted Fees query")
lDone = False
RETURN
endIF
sqlunPosted = SQL
select unitnum,
itemcode,
description,
prepaid,
amount
from escrfees
where Posted = ''
order by ItemCode
endSQL
sqlunPosted.writeSQL("

riv:sqlunPosted.txt")
IF NOT sqlunPosted.executeSQL(dbPriv, "

riv:FeesNotPosted.db") THEN
errorshow("Unable to run Posted Fees query", "Click >> if
displayed")
msgstop("Query Problem", "Unable to run Posted Fees query")
lDone = False
RETURN
endIF
; now add the indexs to link rpt tables
arTables[1] = "

riv:FeesPosted.db"
arTables[2] = "

riv:FeesNotPosted.db"
FOR X FROM 1 to arTables.size()
tbl.attach(arTables[X])
INDEX tbl
PRIMARY
ON "UnitNum", "ItemCode", "Description"
ENDINDEX
endFor
tbl.unattach()
msginfo("","Completed getting fees and transaction for report.")
; finally
lDone = True
btnexit.moveto()
endMethod
;|EndMethod|#Page2.btnTrans|pushButton|
;|BeginMethod|#Page2.btnChecked|pushButton|
method pushButton(var eventInfo Event)
; test of counting whether check box is checked
; instead of adding field to tbl...
VAR
uiFees uiObject ; escrFees table frame
uiMatched uiObject ; matched ui object
frmSelf form ; this form
siChecked smallint ; # check boxes checked
liNumRecs longint ; # records in table frame
x longint ; counter
endVAR
siChecked = 0
liNumRecs = 0
frmSelf.attach()
uiFees.attach(frmSelf.EscrFees)
uiMatched.attach(uiFees.Posted.btnPosted)
liNumRecs = uiFees.nRecords()
uiFees.home() ; go to 1st record
; now loop/move thru tblframe records seeing which records are
checked
FOR X FROM 1 TO liNumRecs
if uiFees.Posted.value = "P" then
siChecked = siChecked + 1
endIF
uiFees.nextRecord()
endFor
siChecked.view("# Checked")
endMethod
;|EndMethod|#Page2.btnChecked|pushButton|
;|BeginMethod|#Page2.EscrFees.#Record9.Posted|chan geValue|
method changeValue(var eventInfo ValueEvent)
var
fldvalue string ; current field value
endvar
{
fldvalue = self.value
;view("changevalue - current")
;message("ChangeValue field value = " + strval(fldvalue))
;sleep(1000)
; add as this assn being selected for purge
if (fldvalue = "") THEN
self.value = "M"
dodefault
; self.view("self changed to M")
; NumSelected = NumSelected + 1
; Assncount.value = NumSelected
endif
; subtract since user made change
if fldvalue = "M" then
fldvalue.blank()
self.value = blank()
dodefault
; self.view("self changed to blank")
{if NOT (NumSelected = 0) THEN
NumSelected = NumSelected - 1
Assncount.value = NumSelected
endif
}
;endif
endMethod
;|EndMethod|#Page2.EscrFees.#Record9.Posted|change Value|
;|BeginMethod|#Page2.EscrFees.#Record9.Posted|newV alue|
method newValue(var eventInfo Event)
; cause value to be committed
; new value coming into fld
var
;currentval string ; new value cominng to field
endvar
;incoming = eventinfo.newvalue()
; doDefault
if eventinfo.reason() = EditValue then
;currentval = self.value
;view(currentval)
;message("New value Self value = " + strVal(currentVal))
;sleep(1000)
dodefault
;self.action(editCommitField)
self.action(dataUnlockRecord)
;action(FieldForward)
endIF
endMethod
;|EndMethod|#Page2.EscrFees.#Record9.Posted|newVal ue|
;|BeginMethod|#Page2.btnExit|pushButton|
method pushButton(var eventInfo Event)
; form closed by calling form MastUnit
; flag lDone = true finished getting rpt data
IF lDone THEN
formReturn("OK")
ELSE
formReturn("Cancel")
endIF
endMethod
;|EndMethod|#Page2.btnExit|pushButton|