I currently have the following Access VBA function, which operates as explained in a previous question (very useful for understanding this question):
Private Fun
I would consider creating a reference table with value field as it easier to maintain specially when the values change overtime.
CREATE TABLE tblReference (field_txt text, val Integer);
Get the field_txt with highest value and unique field then left join(inner join) to your current dataset.
qry_field3_max = "SELECT [Field3],[commonField] FROM tblReference INNER JOIN (SELECT [commonField], MAX(val) as val FROM tblReference INNER JOIN tblNameTemp on tblReference.[field_txt]=tblNameTemp.[Field3] Group By [commonField]) as tbl_max_fields on tblReference.val=tbl_max_fields.val"