The returnerror statement stops a procedure and returns to the calling procedure with an error status. The documentation doesn’t say what happens if you use it in a procedure that wasn’t called from another procedure, as it turns out, in that case there is no calling procedure to handle the error, so the running procedure just stops. The .Initialize procedure is not called by another procedure, but you can see this behavior in any procedure that is not called as a subroutine.
I suppose It could be argued that this is a bug, and that returnerror should behave just like the throwerror statement in this situation. But the documentation is silent on this. I’ll have to think about it.
In any case, I think that anything that puts up a modal dialog in an
.Initialize procedure is a very bad idea, including just a plain old message statement. What if you open multiple databases and more than one starts throwing up alerts & dialogs? I highly discourage that sort of thing. So even if returnerror worked the way you seem to expect it would, I would discourage using that to display an an alert. If you need to inform the user of something, use the nsnotify statement to display a notification – and don’t turn off notifications!!