K
Ken Snell
If DLookup doesn't find a value, it returns Null, so you may need to trap
that before you display your MsgBox. Otherwise, the MsgBox will always
display the text, with or without a value from the DLookup function.
But if that's not the problem that you're seeing, you may need to delimit
(with #) the value from the form for the date value:
result = DLookup("VendorName", "Vendor", "Vendor =" & "'" &
Forms!ExpenseHdrFrm!Vendor & "'" & " AND " & _
"Date =#" & Forms!ExpenseHdrFrm!Date & "#")
that before you display your MsgBox. Otherwise, the MsgBox will always
display the text, with or without a value from the DLookup function.
But if that's not the problem that you're seeing, you may need to delimit
(with #) the value from the form for the date value:
result = DLookup("VendorName", "Vendor", "Vendor =" & "'" &
Forms!ExpenseHdrFrm!Vendor & "'" & " AND " & _
"Date =#" & Forms!ExpenseHdrFrm!Date & "#")