Thanks for your time and effort.
That función works only for a part. Users can still type a number smaler then 1000 (e.g.0009 etc.) And other values like "ert5 23" are ignored. This functions corrects only the format. It changes "1234ab" into "1234 AB", but all other input is ignored.
The problem is that users make (because of working fast) a lot of mistakes in our zip code.
Sounds like you need a validation field option rather than an auto-enter calculation. A validation rule could result in an error message each time the entered code fails to match the specified pattern.
You are right Phil,
A validation would be more appropriate I think. I will work on that one.
Thanks for your everlasting patience,