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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top