Здесь On Error Resume Next
может быть полезным, поскольку ошибка указывает на пустой результат.
Public Function MaxNote() as Variant
MaxNote = "" ' default return value for not records found. Can be NULL or 0 too
On Error Resume Next ' if lookup fails code resumes next line, what is End Function (nothing happens)
MaxNote = CurrentDb.OpenRecordset("MaxNote").Fields("MaxNote") ' fetch the field from first row of recordset (standard after .OpenRecordSet() ), if no results an error is raised, but function resumes next line of code, what ends the function and still with MaxNote = "", the value if no records are found
End Function