By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,675 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

How to delete database objects programmatically

P: n/a
I would like to know how to delete one or more database objects
programmatically.
For example, delete all forms, or all reports, ...etc.

I'm using Access 2003

Thanks,

Mourad
Aug 13 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
JvC
DoCmd.DeleteObject ObjectType, ObjectName

Check the help file for more detail

John

Mourad wrote on 8/13/2008 :
I would like to know how to delete one or more database objects
programmatically.
For example, delete all forms, or all reports, ...etc.

I'm using Access 2003

Thanks,

Mourad

Aug 13 '08 #2

P: n/a
On Wed, 13 Aug 2008 09:24:20 -0700 (PDT), Mourad wrote:
I would like to know how to delete one or more database objects
programmatically.
For example, delete all forms, or all reports, ...etc.

I'm using Access 2003

Thanks,

Mourad
I'm sure you can figure out how to delete all Reports from this:

Dim doc As Document
Dim cont As Container
For Each cont In CurrentDb.Containers
If cont.Name = "Forms" Then
For Each doc In cont.Documents
DoCmd.DeleteObject acForm, doc.Name
Next doc
End If
Next cont

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Aug 13 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.