M
moshe via AccessMonster.com
My table named "paid" has the following fields,
PaidId
CustomerId
Date1
PledgeAmount
PaidAmount
I want a main form should lookup the last pledge, from the customer, and
deduct any PaidAmount afterwards, I have the following code
Private Sub Form_Current()
Dim lastdate
Lastdate = dlast("date1","paid","pledgeAmount"<>0)
'enter data calculation as new balance
!NewBalance = Dsum (0 + "PledgeAmount"-"PaidAmount","Paid","CustomerId="& Me!
CustomerId &" And Date1 >= #"& Lastdate & "#" )
End sub
but when it should calculate i get an error
Syntex error 'customerId = 2 And date1 >=#07/10/2007#'
Could some one help find the right code?
i'm runing access 2007 but i tried it also access 2003
I'll also have to add to this code that if it is more then a year from today
it should of remove the balance
thanks in advance
PaidId
CustomerId
Date1
PledgeAmount
PaidAmount
I want a main form should lookup the last pledge, from the customer, and
deduct any PaidAmount afterwards, I have the following code
Private Sub Form_Current()
Dim lastdate
Lastdate = dlast("date1","paid","pledgeAmount"<>0)
'enter data calculation as new balance
!NewBalance = Dsum (0 + "PledgeAmount"-"PaidAmount","Paid","CustomerId="& Me!
CustomerId &" And Date1 >= #"& Lastdate & "#" )
End sub
but when it should calculate i get an error
Syntex error 'customerId = 2 And date1 >=#07/10/2007#'
Could some one help find the right code?
i'm runing access 2007 but i tried it also access 2003
I'll also have to add to this code that if it is more then a year from today
it should of remove the balance
thanks in advance