matt beamish
Registered User.
- Local time
- Today, 13:04
- Joined
- Sep 21, 2000
- Messages
- 208
Dear all,
I am using the below, on a click event to link images to records, and the code works fine.
I would like to also pick up the created date for each file, and have found this code in the Dev Centre
Can someone show me how I might be able to mash these together?
I did have a go, and got a serious corruption (which I very rarely suffer). I'm not totally sure the corruption was due to my poor coding. Possible related was my database dropping a link to "Windows Script Host Object Model" which is used in a module. Might there be a conflict between that reference and "Scripting.FileSystemObject"?
TIA
Matt
I am using the below, on a click event to link images to records, and the code works fine.
Code:
Private Sub Command5_Click()
Dim f As Object
Dim strFile As String
Dim strFolder As String
Dim strFolderlo As String
Dim varItem As Variant
Set f = Application.FileDialog(3)
f.AllowMultiSelect = True
If f.Show Then
For Each varItem In f.SelectedItems
strFile = Dir(varItem)
strFolder = Left(varItem, Len(varItem) - Len(strFile))
strFolderlo = Replace(strFolder, "HiResPath", "LoResPath")
MsgBox "Folder: " & strFolder & vbCrLf & _
"File: " & strFile
Next
End If
If Not strFolder Like ("*" & "HiRes" & "*") Then
MsgBox "The image is not located in a file/folder structure as instructed and will not be linked."
Exit Sub
Else
Me.Filename = strFile
Me.LoResPath = strFolderlo & strFile
Me.HiResPath = strFolder & strFile
End If
Set f = Nothing
End Sub
I would like to also pick up the created date for each file, and have found this code in the Dev Centre
Code:
Sub ShowFileInfo(filespec)
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile(filespec)
s = "Created: " & f.DateCreated
MsgBox s
End Sub
Can someone show me how I might be able to mash these together?
I did have a go, and got a serious corruption (which I very rarely suffer). I'm not totally sure the corruption was due to my poor coding. Possible related was my database dropping a link to "Windows Script Host Object Model" which is used in a module. Might there be a conflict between that reference and "Scripting.FileSystemObject"?
TIA
Matt