How to delete database objects programmatically

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mourad

    How to delete database objects programmatically

    I would like to know how to delete one or more database objects
    programmaticall y.
    For example, delete all forms, or all reports, ...etc.

    I'm using Access 2003

    Thanks,

    Mourad
  • JvC

    #2
    Re: How to delete database objects programmaticall y

    DoCmd.DeleteObj ect 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
    programmaticall y.
    For example, delete all forms, or all reports, ...etc.
    >
    I'm using Access 2003
    >
    Thanks,
    >
    Mourad

    Comment

    • fredg

      #3
      Re: How to delete database objects programmaticall y

      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
      programmaticall y.
      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.Conta iners
      If cont.Name = "Forms" Then
      For Each doc In cont.Documents
      DoCmd.DeleteObj ect acForm, doc.Name
      Next doc
      End If
      Next cont

      --
      Fred
      Please respond only to this newsgroup.
      I do not reply to personal e-mail

      Comment

      Working...