First of all to stop the dialogs coming keep pressing the Escape key until you get to the "remove private views?" query dialog then click no.
The reason for this error is something to do with the private view. The database I had the problem with had a default private shared on first use view.
To get around the problem try:
1) uninstalling and reinstalling notes for the user (takes too long and didn't always work)
2) remove the private view and use a single category view (I couldn't do this because the view was a calendar view)
3) Add an exit button to the navigator or view that moved the focus to another database that did not have private views:
REM "See http://www.NotesNinjas.com/#CloseDownBug";
@PostedCommand([FileCloseWindow]);
@PostedCommand( [AddDatabase] ; "SERVER/CORP" : "names.nsf" )
4) Add code to the database queryclose event which does the same thing:
' See: http://www.notesninjas.com/#CloseDownBug"
Dim uiw As New notesuiworkspace
Call uiw.adddatabase( "SERVER/CORP" , "names.nsf" )
If you find another solution let me know.