I have an Access DB that has the following tables:
• 'Legal Entity Info' with [LegEntID] and [LegEntName]
• 'Policy Info' with [PolicyID] and [PolicyCarrierName]
• 'Policy Period' with [PolicyPeriodID] and [PolicyPeriod]
• 'Retention Amounts by Legal Entity' with [RetentionID], [PolicyPeriodID], [PolicyID], [LegEntID] and [RetentionAmount]
I have a form (Retention Payment Info Form), that pulls in the [PolicyPeriodID], [PolicyID], and [LegEntID] that are connected with a specific claim. I need to pull in the correct [RetentionAmount] that corresponds to the match in the 'Retention Amounts by Legal Entity' table. All three criteria ([PolicyPeriodID], [PolicyID], and [LegEntID]) have to be TRUE in order to pull in the correct [RetentionAmount].
On this form, I have an unbound field to show the [RetentionAmount] and I’m trying to write a DLookup function to select the [RetentionAmount] based on the selections on the form. Here is what I think it should look like, however, it’s not working.
=DLookUp("[RetentionAmount]",
"Retention Amounts by Legal Entity",
"[PolicyPeriodID]='" & Forms![Retention Payment Info Form].Form.[PolicyPeriodID] &
"' AND [PolicyID]='" & Forms![Retention Payment Info Form].Form.[PolicyID] &
"' AND [LegEntID]='" & Forms![Retention Payment Info Form].Form.[LegEntID] &
"'")
Any suggestions?
.Form.by!in all 3 expressions, but that shouldn't make a difference. If these IDs are numbers, remove the single quotes. Else: please clarify "it’s not working.". - Andre