Closing document closes database

I have just created a new lotus notes database. It is very simple in that it only has one form. But in testing when ever I try to create a new document and save it it closes the document and the database. I have tried using “uidoc.close” and @Command([FileCloseWindow]). Any thoughts?

Subject: Post all the code…

How do you create the document? From where?Post the code.

How do you save and close it? Post the code.

Or why not upload the .NSF somewhere (no local encryption, default access set to Designer) so we can look at it.