Prevent textboxes from being auto-trimmed
Posted on 2006-07-21
I've created a function on one of my continuous database forms that filters the results as you type in a textbox (using the onChange event). The problem here is that when the event fires, it seems to momentarily cause the textbox to lose focus, which then has all spaces trimmed from the beginning and end of the box. Because of this, a user cannot filter by more than one word because everytime a space is typed, it just disappears when the change event fires.
Does anyone know how to either: stop the onChange event from firing when a space is typed, prevent the textbox from losing focus, or stop Access from auto-trimming the field?