I've been trying to come back to this and chip away for months with little progress. It's tough to explain so I've included a sample DB.
What I want to do is compare the 'distance' between the two tables, tblKnown and tblFind.
Using the closest matching 'distance' fields to join the records, the 'dip' value will be copied from tblKnown to the 'NearestDip' in tblFind. The same is needed for 'Dir' and 'NearestDir'. It is important that the project ID be matching as well.
To try to sum this up again... The values in tblFind will be updated using values in tblKnown. Which records are selected is dictated by where 'Distance' in tblKnown most closely matches the 'Distance' in tblFind.
I have filled a few of the values in tblFind as an example. But 'NearestDip' and 'NearestDir' will always be updated by the query (I hope).
If the difference between 'Distance' is split evenly between two records in 'tblKnown', then I don't care which one gets picked. Preferably the one with the lowest 'Distance' value.
I hope that makes sense. I've been scratching my head with DLookup, ELookup, etc. off and on for quite a while. If this can be done without more advanced functions then that would be great too.Nearest1.accdb