Quick LS to trim all text fields
Years ago I would use translation formulas on fields to keep the extra white space trimmed. Realizing that this was quite a performance hit on all but the most trivial forms, I began using exiting events. For some ridiculous reason, it didn't hit me until now to just plop a few lines in the QuerySave event to keep all fields trimmed up:
' Eliminate any extra white space in the fields
Forall itm In doc.Items
If itm.Type = 1280 Then
' Text field
Call doc.ReplaceItemValue( itm.Name, Trim$(itm.Text) )
End If
End Forall
The one caveat (so far :-) is to add a line or two to exclude any checkbox fields from that code. The trim seems to wipe out the contents of checkbox fields. Need to do more testing on that one, but it's quick enough to just add a list of checkbox fields (and maybe radio button, etc?) and have a glance at the list before doing the trim.