hello all
i have a do/while loop in a function that should perform an arithmetic expression and return a resulting value to an access form. the compiler does not like my syntax when i phrase the expression as it appears below. i get the error: 'expected statement, not variable.' i also need to keep a running total of the variable NewD...cant do this until the arithmetic gets done. can anyone help? if you have a
better idea about logic or syntax, im open to it.
Public Function DTotal(curD, curC, curNewD, curNewC)
Let curD = Forms![N_C].D
Let curC = Forms![N_C].C
Let curNewC = curC - curD
Let curNewD = curD - curC
If (curC < curD) Then
Do While (booleanApply = True And booleanXhaust = False)
curD-curC'''''''''''''''''''''''''''''''''''problem expression
intCount 1
Forms![N_C].[Amount_of_D_Remaining].Print curNewD
If Count = 3 Then
Exit Do
End If
Else
If (curD < curC) Then
curC -curD = curNewC
Forms![N_C].[Amount to be Paid].Print curNewC
End If
End Function
Thanks!
jmbt
i have a do/while loop in a function that should perform an arithmetic expression and return a resulting value to an access form. the compiler does not like my syntax when i phrase the expression as it appears below. i get the error: 'expected statement, not variable.' i also need to keep a running total of the variable NewD...cant do this until the arithmetic gets done. can anyone help? if you have a
better idea about logic or syntax, im open to it.
Public Function DTotal(curD, curC, curNewD, curNewC)
Let curD = Forms![N_C].D
Let curC = Forms![N_C].C
Let curNewC = curC - curD
Let curNewD = curD - curC
If (curC < curD) Then
Do While (booleanApply = True And booleanXhaust = False)
curD-curC'''''''''''''''''''''''''''''''''''problem expression
intCount 1
Forms![N_C].[Amount_of_D_Remaining].Print curNewD
If Count = 3 Then
Exit Do
End If
Else
If (curD < curC) Then
curC -curD = curNewC
Forms![N_C].[Amount to be Paid].Print curNewC
End If
End Function
Thanks!
jmbt