
Your question seems to be missing some important information. If you can't imagine making it work with either one then you might need to write your own function and use a DAO recordset (or ADO if you prefer that for some reason). Use DCount when you want to return a count of records meeting your criteria. Use DLookup when you want to return a single value from a single field in a single row. I'm playing with this now (having some trouble replicating the syntax and am considering using FindFirst/FindNext with criteria, then looping), but am getting conflicting opinions on if this is possible or how to go about writing this code. I did research and it appears using Recordsets and VBA would be the way to go. I need to design it so the criteria produces multiple values. This is what that DLookup function looks like:ĭLookUp("","Container Efficiency","='" & & "' And ='" & & "' And #" & & "#")) That's because Dlookup is designed to only find the first value that matches the criteria, not all records.įor example: Inefficiently Used Unit Overlooked Unit However, each record in the query returns only Unit A when using Dlookup. The above would result in my query spitting out Unit C twice and unit D twice, which is fine. However, I need to identify which specific older Units were impacted by the failure to do FIFO.

So far I've gotten it to work to an extent using a DLookup function. Next week when a unit is selected for consumption, ideally we are using Unit 1, but if not, I'm building a query to identify this. I'm trying to calculate a FIFO auditing analysis of inventory control.
