Jan,
Thanks. It works like a champ.

Unfortunately I now have two other problems. I copied the form before adding the BitButtons and RowID to it
so the comparison between the before/after is fairly easy. Still I cannot find the cause of the following....

Problem 1.
The late fee is calculating consistently but sometimes blanks as I scroll from region to region.
Problem 2.
The balance per rent line entry isn't consistently including the late fee.

The Late Fee (Late) is calculated in the scrolling region based on Postmark date.
The balance per rent line entry is calculated in the scrolling region. It is the addition of
(Rent + Special + Late + Bounce) - AmReceived

Neither of these problems occur in the original Form, Rentroll2.

Here are the variables in the original form

Form :  rentroll2

Main Table :  ACCTPROM
1 : TEXT    vpropname = propname in procdate where propname = propname
2 : TEXT   fname = fnamer in tenant where acct = acct
3 : TEXT   lname = lnamer in tenant where acct = acct
4 : TEXT    v1name = (fname & lname)
5 : INTEGER   addr1 = addr1r in tenant where acct = acct
6 : TEXT   vstcode = stcode in tenant where acct = acct
7 : TEXT   addr = street in commaddr where stcode = .vstcode

Table :  RENTROLL
8 : TEXT   acct = acct in acctprom where acct = acct
9 : DATE   ddate2 = duedate
10 : DATE   postd = postdate
11 : REAL   lcalc = (((.postd - .ddate2) / 7) + .45)
12 : REAL   llook = (anint(.lcalc))
13 : CURRENCY   late = latefee in late where .llook = latelook
14 : CURRENCY   vcurbal = ((rent + special + late + Bounce) - amrec)
15 : TEXT   rcode = P
16 : CURRENCY   Vbaldue = baldue in balate where acct = acct
17 : CURRENCY   vReceipt = amrec in rentroll where acct = acct
18 : CURRENCY   vtotalbal = (.vtotalbal + .vReceipt)

Here are the variables in the form with RowID and BitButtons Added
Main Table :  ACCTPROM
1 : TEXT    vpropname = propname in procdate where propname = propname
2 : DATE   bankp = bankdate in procdate
3 : DATE   postp = postdate in procdate
4 : TEXT   fname = fnamer in tenant where acct = acct
5 : TEXT   lname = lnamer in tenant where acct = acct
6 : TEXT    v1name = (fname & lname)
7 : INTEGER   addr1 = addr1r in tenant where acct = acct
8 : TEXT   vstcode = stcode in tenant where acct = acct
9 : TEXT   addr = street in commaddr where stcode = .vstcode

Table :  RENTROLL
10 : TEXT   acct = acct in acctprom where acct = acct
11 : INTEGER   vrowid = rowid
12 : DATE   ddate2 = duedate
13 : DATE   postd = postdate
14 : REAL   lcalc = (((.postd - .ddate2) / 7) + .45)
15 : REAL   llook = (anint(.lcalc))
16 : TEXT    vspchg = spchg
17 : CURRENCY   late = latefee in late where .llook = latelook
18 : CURRENCY   vcurbal = ((rent + special + late + Bounce) - amrec)
19 : TEXT   rcode = P
20 : CURRENCY   Vbaldue = baldue in balate where acct = acct
21 : CURRENCY   vReceipt = amrec in rentroll where acct = acct
22 : CURRENCY   vtotalbal = (.vtotalbal + .vReceipt)

Here is the eep that executes when moving from line to line in the
scrolling region to reset Late (if necessary) as well as dynamically
update the displayed total account balance at the top of the form.

set var vacct = acct in acctprom
set var vbal currency
select sum cubal into vbal from rentroll where acct = .vacct
update balate set baldue = .vbal where acct = .vacct
update rentroll set late = null where acct = .vacct and .vspchg exists
recalc variables
clear var vbal vacct vspchg
return

Thanks again for your assistance. The contributions have been a
tremendous help.

Ed

Aug 3, 2009 03:19:19 PM, [email protected] wrote:
Ed,
 
In your bit button try this;
update rentroll set bankdate = .bankp where rowid = .vrowid
recalc var
PROPERTY TABLE rentroll 'REFRESH'
RETURN
 
Jan

Reply via email to