G
Guest
I have the following expression in a query that's giving me an error msg.
that the string is too long. I'm hoping I can rewrite this into a function
and then put the function in the query. But, I'm not sure how the write a
function that imulates the following expression. If someone could get me
started I'd really appreciate it. Thank you.
Status1Parent: IIf([Status]="6",IIf(DLookUp("[LTD]","NQ","[CP] = '" &
[PartOne] & "' AND [Status] = '1'") Is Not Null,DLookUp("[LTD]","NQ","[CP] =
'" & [PartOne] & "' AND [Status] = '1'"),IIf(DLookUp("[LTD]","NQ","[CP] = '"
& [PartTwo] & "' AND [Status] = '1'") Is Not Null,DLookUp("[LTD]","NQ","[CP]
= '" & [PartTwo] & "' AND [Status] = '1'"))),IIf(DLookUp("[LTD]","NQ","[CP] =
'" & [PartThree] & "' AND [Status] = '1'") Is Not
Null,DLookUp("[LTD]","NQ","[CP] = '" & [PartThree] & "' AND [Status] =
'1'"),IIf(DLookUp("[LTD]","NQ","[CP] = '" & [PartFour] & "' AND [Status] =
'1'") Is Not Null,DLookUp("[LTD]","NQ","[CP] = '" & [PartFour] & "' AND
[Status] = '1'"),[LTD])))
that the string is too long. I'm hoping I can rewrite this into a function
and then put the function in the query. But, I'm not sure how the write a
function that imulates the following expression. If someone could get me
started I'd really appreciate it. Thank you.
Status1Parent: IIf([Status]="6",IIf(DLookUp("[LTD]","NQ","[CP] = '" &
[PartOne] & "' AND [Status] = '1'") Is Not Null,DLookUp("[LTD]","NQ","[CP] =
'" & [PartOne] & "' AND [Status] = '1'"),IIf(DLookUp("[LTD]","NQ","[CP] = '"
& [PartTwo] & "' AND [Status] = '1'") Is Not Null,DLookUp("[LTD]","NQ","[CP]
= '" & [PartTwo] & "' AND [Status] = '1'"))),IIf(DLookUp("[LTD]","NQ","[CP] =
'" & [PartThree] & "' AND [Status] = '1'") Is Not
Null,DLookUp("[LTD]","NQ","[CP] = '" & [PartThree] & "' AND [Status] =
'1'"),IIf(DLookUp("[LTD]","NQ","[CP] = '" & [PartFour] & "' AND [Status] =
'1'") Is Not Null,DLookUp("[LTD]","NQ","[CP] = '" & [PartFour] & "' AND
[Status] = '1'"),[LTD])))