Trimming Whitespace on Save

Hi All,

I've got a form which I use to add records to a table. Some of the fields are text or varchar fields.

What do I need to do, so that when I click the Save Record button, the form automatically strips leading and trailing whitespace from the text fields. I know that there's a trim function, but I can't figure out how to tie it into the form.

Thanks.

Hi Ian,

What do I need to do, so that when I click the Save Record button, the
form automatically strips leading and trailing whitespace from the text
fields. I know that there's a trim function, but I can't figure out how
to tie it into the form.

Either :

1) a trigger

or

2) a macro that gets fired on the Save record button, or alternatively
an executeSQL statement object that you could tie in to a separate
button on the form..

(1) is complicated to set up with the default version of hsqldb 1.8
included in LO, basically because you would have to write it in Java and
then find some way to call it from within the embedded hsqldb instance
(good luck !)

(2) is probably the easier of the two routes.

If you are not using the default hsqldb embedded database instance, then
I'm assuming you're using a proprer RDBMS which has triggers and that
you know how to use them.

Alex