Joe,

 

Try this...

 

Sub CheckForFile

Dim stFile as String

Dim sFileName as String

sFileName = "SnapshotFileName"

stFile = "C:\Snapshots\" & sFileName

If FileExists(stFile) = True Then

            "Do Something"

End If

End Sub

 

Function FileExists(strFile as String) as Boolean

    FileExists = (Len(Dir(strFile)) > 0)

End Function

 

 

Craig Gross

Sales Reporting Analyst/VBA-Developer

Baker & Taylor

908-541-7197

[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of myhnews
Sent: Friday, January 05, 2007 12:17 AM
To: [email protected]
Subject: [Access VBA Central] Multiple snapshots for each report

 

I currently use the following function

Private Sub Report_Activate()
DoCmd.OutputTo 
acOutputReport, "rptInvoice", "Snapshot", "C:\Snapshots\" & Reports!
Invoice.OrderNo & ".snp", True
End Sub

However, I would like to keep a copy of each invoice version 
submitted to the customer (usually there is no more than 4).
My solution would be to create 4 
fields "snapshot1" , "snapshot2" , "snapshot3" , and "snapshot4" for 
each order.
The Report_Activate function will be removed.
It will be required to select the version before working with the 
following buttons. 
There will be a button "Create snapshot" which will create the file 
and save it into the snapshot folder, the file name will be the 
orderNo. 
For the second version, the file name will be the OrderNo & - & 1 
like 5657, 5657-1, 5657-2

Another button "Add", which will fill in the file name into the 
field snapshot1
Another button "Del", which will delete the file name from the field 
snapshot1
Another button "View", which will search for a snapshot file with a 
name matched the field snapshot1

What I need now, is a function that searches in the folder for a 
snapshot with the name matched the field on the form. Can anyone 
help me with this?

First I was thinking of creating a sub table that keeps the snapshot 
names for each order, but it turned out to be more coding.

I would appreciate if you can also tell me if there are any other 
ways.

Thank you
Joe

 



This email and any attachments contain information from Baker & Taylor which 
may 
be confidential, privileged and/or protected by other legal rules. If you are 
not the
intended recipient, you are hereby advised that any disclosure, copying, 
distribution or
use of the contents of this email is prohibited. If you have received the email 
in error, 
please notify us by reply email immediately and then delete the email and your 
reply
from your email system. NOTE: Baker & Taylor accepts no liability for the 
contents of 
this email. This email shall not operate to bind Baker & Taylor to any 
contract, order 
or other obligation. 


[Non-text portions of this message have been removed]

Reply via email to