NMR has one of its laboratories at Calibre Business Park, Four Ashes, near Wolverhampton.
AB Foods – which also has major sugar, foods and ingredients businesses – said the deal would boost its agriculture-food arm, which works with more than 2,000 UK dairy farms as part of its global operations.
AB Foods has agreed to pay 215p a share for NMR, with backing for the deal already from investors holding around 69 per cent of shares, which is close to the 75% threshold needed to approve the deal.
AB Agri operates across 80 countries and employs more than 3,000 staff.
It supplies animal feed, supplements and specialist ingredients, as well as services and expertise to farmers, feed and food manufacturers and retailers.
AB Foods said adding National Milk Records' expertise would help its agriculture arm to deliver a "better service to the dairy industry, initially in the UK, offering products that deliver increased value, efficiency and ultimately profitability for farmers".
Jose Nobre, chief executive of AB Agri, said: "We have supported dairy farmers for more than 30 years with nutrition and specialty feed products, and more recently with data and technology platforms which deliver insights that create continuous improvement in agricultural supply chains.
"Acquiring National Milk Records is an extension of this strategy and will enable us to service the industry better, offering products that deliver increased value, efficiency and ultimately profitability for dairy farmers."
Trevor Lloyd, chairman of NMR, added: "ABF's and AB Agri's status within the UK agricultural sector and expertise in the dairy industry will provide a significant benefit to NMR's customers."
National Milk Records, which is listed on the Aquis Stock Exchange for smaller companies, provides milk recording and testing services, invoicing more than 3,000 farms every month. It was formed in 1943 and has its head office at Chippenham.
It also offers milk payment testing services to the majority of the UK's milk processors and provides disease testing for individual animals and whole herd analysis through its laboratories.
If given the go-ahead by shareholders, the deal is expected to complete in the third quarter.