closing forms

R

Roy

docmd.close - close 1 single form
how can i close all form that are open in the database.

thanks
 
A

Allen Browne

Dim i As Integer
For i = Forms.Count - 1 to 0 Step -1
DoCmd.Close acForm, Forms(i).Name
Next

Use error handling in case a form is dirty and the record cannot be saved.
 
Top