>My question was about preventing invalid input directly in tables. In forms I use Table buffering and catch all problems gracefully (or, at least, I hope so). However, if user just opens table in command window (use myTable), then append blank, my original procedure didn't prevent from 3 "0" despite the fact, that I have a PK set. I hope, that Steve's solution would work for these situations. I already implemented it, but haven't tested yet.
Nadya,
I don't see any difference here. Default values for a field apply when table is opened in a form, when the user opens the table in the command window, or even when the table is opened indirectly through a view.
Of course, the user can change the value later - but triggers, too, apply both in forms and in the command window.
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)