Access data macro get value from query (auto numbering)
问题 Instead of the using the auto number in Access (sometimes produces duplicates) I've decided to generate my own numbers. I am using the data macro Before Change but I'm not sure on how to run the query SELECT MAX(ID)+1 FROM MyTable and insert it into the ID field on each Insert . I've messed around with the SetField, SetLocalVar, LookUpRecord actions but no luck so far. EDIT: I've tried using DMAX in the expression as per example: https://www.599cd.com/tips/access/incrementing-your-own-counter