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 / Forms Programming / November 2005

Tip: Looking for answers? Try searching our database.

Problem with kill in a form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe Cilinceon - 28 Nov 2005 18:20 GMT
I have a routine that prints a series of reports into PDF files. From them
it combines them to a single PDF  and saves them under a new name in another
folder for emailing at will.  I have a the following lines to delete any old
PDF files in the group folder and I'm having a problem in that it stops the
routine if there are none there. What would the code be to test to see if
there are any PDF files and if so delete them otherwise go on with the
process. The code I'm using is as follows:

Dim SourceFile As String

SourceFile = Application.CurrentProject.path & "\Reports\*.PDF"
Kill SourceFile

I know I could add this code at the end but I don't always want to delete
them right away. These reports are produced every Monday morning.

Signature

Joe Cilinceon

RuralGuy - 28 Nov 2005 18:32 GMT
If Dir(SourceFile) <> vbNullString Then
   Kill SourceFile
End If

>I have a routine that prints a series of reports into PDF files. From them
>it combines them to a single PDF  and saves them under a new name in another
[quoted text clipped - 11 lines]
>I know I could add this code at the end but I don't always want to delete
>them right away. These reports are produced every Monday morning.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
Joe Cilinceon - 28 Nov 2005 19:07 GMT
> If Dir(SourceFile) <> vbNullString Then
>    Kill SourceFile
> End If

Thanks worked perfectly.

Signature

Joe Cilinceon

 
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.