I am having a problem with this line of code
txtCost = DLookup("[Cost]", "tblTreatments", "[TreatmentRef]=forms!frmVisits!frmSubTreatmentsByLine![txtTreatmentRef]")
I have a table tblTreatments which includes fields Cost and TreatmentRef.
I have a subform on frmVisits named frmSubTreatmentsByLine
On form frmSubTreatmentsByLine I have a field Cost named txtCost
Can anybody advise me why this DLookup code will not work.
I have several other DLookups in the database and they all work as intended.
I have spent the best part of an afternoon trying to identify a fault but cannot see one.
I would really appreciate any assistance someone can offer me.
Regards
Cheyanne