How to delete the forms with vba?

T

Tom

Hi

I'd like to delete all forms, reports and modules, which are stored within
the database. How to do? Thanks in advance.

Tom
 
N

Naresh Nichani MVP

Hi:

Use CurrentDb.Containers to access Forms, Reports and Modules on datbaase.

currentdb.Containers(2) - this gives access to Forms in datbaase.

Then for each form you need to use a
DoCmd.DeleteObject acForm, "FormName"

to delete the form.

Regards,

Naresh Nichani
Microsoft Access MVP
 
Top