Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Importing / Linking / June 2007

Tip: Looking for answers? Try searching our database.

Deleting a Report Before Using TransferDatabase

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rmcompute - 19 Jun 2007 23:04 GMT
I am using TransferDatabase to import a report from another database.  The
report gets named with a 1 on the end.  How can I delete the existing report
first to prevent this from happening ?  For tables, I use the following code.
Is there an equivalent method for reports ?

For Each tdef In db.TableDefs
     If tdef.Name = "TestTable" Then
       DoCmd.DeleteObject acTable, tdef.Name
       Exit For
     End If
   Next tdef
Jeff Boyce - 19 Jun 2007 23:07 GMT
You are trying to delete a report, and you are calling "TableDefs"?  Tables
and reports are two different types of objects.

Regards

Jeff Boyce
Microsoft Office/Access MVP

>I am using TransferDatabase to import a report from another database.  The
> report gets named with a 1 on the end.  How can I delete the existing
[quoted text clipped - 9 lines]
>      End If
>    Next tdef
rmcompute - 20 Jun 2007 23:29 GMT
I was using the code as an example of how I deleted the table.  For the
report I could not locate an equivalent for TableDefs i.e. ReportDefs.  Could
I simply type the following:

DoCmd.DeleteObject acReport, "TestReport"

> You are trying to delete a report, and you are calling "TableDefs"?  Tables
> and reports are two different types of objects.
[quoted text clipped - 17 lines]
> >      End If
> >    Next tdef
Jeff Boyce - 21 Jun 2007 00:08 GMT
What happens when you try that?

Regards

Jeff Boyce
Microsoft Office/Access MVP

>I was using the code as an example of how I deleted the table.  For the
> report I could not locate an equivalent for TableDefs i.e. ReportDefs.
[quoted text clipped - 26 lines]
>> >      End If
>> >    Next tdef
rmcompute - 28 Jun 2007 23:28 GMT
When I tried it initially, it did not seem to delete the report.  I tried it
again and it seems to be working.  Thank you.

> What happens when you try that?
>
[quoted text clipped - 33 lines]
> >> >      End If
> >> >    Next tdef
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.