Longest Data Element

Here is a bit of MS Access code to determine the longest text in a field. Useful if you’ve imported a text file and want to trim the size of the resulting text field down from the default of 255. Create a query with the following formula in a field:

Text_Length: Max(Len([Table_name]![Field_name]))