I’m having difficulty using DLookup in a query to calculate the “Morphine Equivalent Dosage (MED)” for medications taken. I have two tables and a query:
- tblTreatment – lists a medication taken, the dosage, and number of pills (this table is uploaded from excel)
- qryTreatment – based off of tblTreatment
- tblMEDLookup – lists medications and there morphine equivalent dosage (MED)
I'm trying to add a column to qryTreatment (called MED_Med1) that looks up the MED for a a medication taken (from tblMEDLookup) and multiplies it by the Dosage taken and Number of pills (from tblTreatment). The following picture illustrates this.
The expression I've tried to implement in qryTreatment to get MED_Med1 is the following:
MED_Med1: DLookUp("MED","tblMEDLookup","Analgesic= '" & Nz("[RescueMed1]",0) & " ' ")*([tblTreatment]![RescueMedDose1])*([tblTreatment]![RescueMedPill1])
So far this only returns blank values as shown below:
Any help on this issue would be very much appreciated.