I am trying to limit the number of records displaying in a subform [amendedLoans] by selecting only those records that have the same ClientID as the mainform [Customers] and the same loan number as the subforms parent form [ClientAccounts loan changes].[loanno].
I have no difficulty selecting records just using the clientid but as soon as I add the reference to the subform [loanno] field I get no selection of records. I suspect there is an error in the where clause for
.
I have built the clause using the expression builder and have had many attempts all ending up with the same result. I'm now at a loss as to where to go from here.
I have no difficulty selecting records just using the clientid but as soon as I add the reference to the subform [loanno] field I get no selection of records. I suspect there is an error in the where clause for
Code:
[Amended Loans].Loan)=[Forms]![customers]![ClientAccounts loan changes].[Form]![LoanNo])
I have built the clause using the expression builder and have had many attempts all ending up with the same result. I'm now at a loss as to where to go from here.
Code:
SELECT [Amended Loans].AmendedLoanID, [Amended Loans].Loan, [Amended Loans].UpdateID, [Amended Loans].Newloanamount, [Amended Loans].Newpayment, [Amended Loans].NewRate, [Amended Loans].NewPeriod, [Amended Loans].NewLimit, IIf([newperiod]="w",[newpayment]*52/12,IIf([newperiod]="f",[newpayment]*26/12,IIf([newperiod]="m",[newpayment],0))) AS NewMonthAmount, [Amended Loans].from, [Amended Loans].ClientID
FROM [Amended Loans]
WHERE ((([Amended Loans].Loan)=[Forms]![customers]![ClientAccounts loan changes].[Form]![LoanNo]) AND (([Amended Loans].ClientID)=[forms]![customers]![clientid]))
ORDER BY [Amended Loans].UpdateID;