I am trying to lookup the clinder barcode inputed into Stringy1, i occordance with the latest inout for that cylinder barcode number. I the cylnder number is already delivered a message below should appear, can anyone see why this code is not wkring
StrSQ4 = DLookup("[D Status]", "tbl_Delupdate", "[Cylinder Barcode Label]='" & Stringy1 & "' AND [Date of D Status]=#" _
& DMax("[Date of D Status]", "tbl_Delupdate", "[Cylinder Barcode Label] = '" & Stringy1 & "'") & "#")
If Trim(StrSQ4 & "") = "Delivered" Then
MsgBox "Barcode Number is already delivered. Please re-check and try again", vbCritical, "Barcode Number