Hi georgp,
I think using SQL is probably the best way to do this, although it could also be done using recordsets.
[blue]Function[/blue] getMode(myFLD As String, myTable as String)
[green]' returns the mode of a given field from a given table[/green]
Dim db As Database, rs As Recordset, strSQL As String
Set db = CurrentDb
strSQL = "SELECT DISTINCT " & myFLD & ", Count(" & myFLD & "

AS Freq"
strSQL = strSQL & " FROM " & myTable
strSQL = strSQL & " GROUP BY " & myFLD
strSQL = strSQL & " ORDER BY Count(" & myFLD & "

DESC;"
Set rs = db.OpenRecordset(strSQL)
if rs.RecordCount>0 then
rs.MoveFirst
getMode = rs.Fields(0)
else
getMode = "" ' or Null
End If
rs.Close
Set db = Nothing
[blue]End Function[/blue]