Hello - I have been reading up on this function, but I have run across some syntax that I don't quite understand, here it is:
Let's say this is in a textbox called "txtMyText"
=IIf(DLookUp("[OrigPro-RatedPremium]","PaySchedule","[AccountID]=" & [AccountID] & " AND [Year] = '" & [Year] & "'" Is Not Null,DLookUp("[OrigPro-RatedPremium]","PaySchedule","[AccountID]=" & [AccountID] & " AND [Year]='" & [Year] & "'",DLookUp("[EstPremium]","PolicyPremiums","[AccountID]=" & [AccountID] & " AND [Year] = '" & [Year] & "' AND [PayPeriodID]=1")
Specifically I am having trouble understanding what the "&" is doing as well as the "AND" statement.
I know that "&" generally signifies a concatenation, and that "AND" usually limits criteria in a query search.
That being given. Could somebody help translate, especially this part:
DLookUp("[OrigPro-RatedPremium]","PaySchedule","[AccountID]=" & [AccountID] & " AND [Year]='" & [Year] & "'",
which i think says something like "OK, look in a field called [OrigPro-RatedPremium] in a table called "PaySchedule" where Account ID = (.......and then I get confused....)
If someone could help me understand the (....and then I get confused....) part I'd be grateful.
SteveC.
Let's say this is in a textbox called "txtMyText"
=IIf(DLookUp("[OrigPro-RatedPremium]","PaySchedule","[AccountID]=" & [AccountID] & " AND [Year] = '" & [Year] & "'" Is Not Null,DLookUp("[OrigPro-RatedPremium]","PaySchedule","[AccountID]=" & [AccountID] & " AND [Year]='" & [Year] & "'",DLookUp("[EstPremium]","PolicyPremiums","[AccountID]=" & [AccountID] & " AND [Year] = '" & [Year] & "' AND [PayPeriodID]=1")
Specifically I am having trouble understanding what the "&" is doing as well as the "AND" statement.
I know that "&" generally signifies a concatenation, and that "AND" usually limits criteria in a query search.
That being given. Could somebody help translate, especially this part:
DLookUp("[OrigPro-RatedPremium]","PaySchedule","[AccountID]=" & [AccountID] & " AND [Year]='" & [Year] & "'",
which i think says something like "OK, look in a field called [OrigPro-RatedPremium] in a table called "PaySchedule" where Account ID = (.......and then I get confused....)
If someone could help me understand the (....and then I get confused....) part I'd be grateful.
SteveC.