M
MBSNewbie
Hi Everyone,
I know the answer to this is going to be a simple one, but I have writers
block over here so I'm hoping someone can pull me out!
I want Access to look and see if 3 files exist on the fileserver and return
the create dates of those files.
I can do it for each record individually if I add it to the GotFocus, but
then I have to manually click on each record to get an update.
I can't figure out how to add it as a query, also can't figure out how to
loop it so I'm out of options!
-----------------------------------------------------------------------------------------------------------------------------------
Here is what I have so far, but of course, it only updates the first record
in the list: (Clear as mud right?)
Private Sub Form_Load()
Dim oFSO As Object
Dim oF As Object
Dim strFile As String
Set oFSO = CreateObject("Scripting.FileSystemObject")
strFile = "S:\A&P\BOL\BOL" & Trim(Me![CSTPONBR]) & ".pdf"
If oFSO.FileExists(strFile) = True Then
Set oF = oFSO.GetFile(strFile)
BOLStatus = oF.DateCreated
Else
BOLStatus = ""
End If
Set oF = Nothing
Set oFSO = Nothing
Set oFSO = CreateObject("Scripting.FileSystemObject")
strFile = "S:\A&P\POD\POD" & Trim(Me![CSTPONBR]) & ".pdf"
If oFSO.FileExists(strFile) = True Then
Set oF = oFSO.GetFile(strFile)
PODStatus = oF.DateCreated
Else
PODStatus = ""
End If
Set oF = Nothing
Set oFSO = Nothing
Set oFSO = CreateObject("Scripting.FileSystemObject")
strFile = "S:\A&P\PO\PO" & Trim(Me![CSTPONBR]) & ".jpg"
If oFSO.FileExists(strFile) = True Then
Set oF = oFSO.GetFile(strFile)
POStatus = oF.DateCreated
Else
POStatus = ""
End If
Set oF = Nothing
Set oFSO = Nothing
End Sub
I know the answer to this is going to be a simple one, but I have writers
block over here so I'm hoping someone can pull me out!
I want Access to look and see if 3 files exist on the fileserver and return
the create dates of those files.
I can do it for each record individually if I add it to the GotFocus, but
then I have to manually click on each record to get an update.
I can't figure out how to add it as a query, also can't figure out how to
loop it so I'm out of options!
-----------------------------------------------------------------------------------------------------------------------------------
Here is what I have so far, but of course, it only updates the first record
in the list: (Clear as mud right?)
Private Sub Form_Load()
Dim oFSO As Object
Dim oF As Object
Dim strFile As String
Set oFSO = CreateObject("Scripting.FileSystemObject")
strFile = "S:\A&P\BOL\BOL" & Trim(Me![CSTPONBR]) & ".pdf"
If oFSO.FileExists(strFile) = True Then
Set oF = oFSO.GetFile(strFile)
BOLStatus = oF.DateCreated
Else
BOLStatus = ""
End If
Set oF = Nothing
Set oFSO = Nothing
Set oFSO = CreateObject("Scripting.FileSystemObject")
strFile = "S:\A&P\POD\POD" & Trim(Me![CSTPONBR]) & ".pdf"
If oFSO.FileExists(strFile) = True Then
Set oF = oFSO.GetFile(strFile)
PODStatus = oF.DateCreated
Else
PODStatus = ""
End If
Set oF = Nothing
Set oFSO = Nothing
Set oFSO = CreateObject("Scripting.FileSystemObject")
strFile = "S:\A&P\PO\PO" & Trim(Me![CSTPONBR]) & ".jpg"
If oFSO.FileExists(strFile) = True Then
Set oF = oFSO.GetFile(strFile)
POStatus = oF.DateCreated
Else
POStatus = ""
End If
Set oF = Nothing
Set oFSO = Nothing
End Sub