< Back

Document Subject: Stop Deletion of one sort of form
Hint Short Cut: Add this to your code & documentation to help you find this page.
http://#StopFormDelete or http://A555F9/nn.nsf/ByAlias/StopFormDelete

Here is some code to stop the deletion of one sort of  form in a database. I used this to prompt the user to press a button to delete the form. This then checks that the form is the correct status and also deletes any associated child documents.




 

This code will prevent a user from deleting any Form called "Questions".

Stick this in the QueryDocumentDelete event

 

Dim col As notesdocumentcollection
Set col = source.documents

Dim doc As notesdocument
Set doc = col.getfirstdocument
Do Until doc Is Nothing
 If doc.Form(0)="Questions" Then
  continue = False
  Messagebox "Please use the button!"
 End If
 Set doc = col.getnextdocument(doc)
Loop