Hi Every one
I have a table named Table1 and it has two fields 'ID' and an 'Files' (Attachment field with multiple records). I made a query By draging the ID and File name component of the attachment field. My form is based on That query. Now I have 2 fields on the form .The 'ID' field and 'Table1.Files.FileName' . I renamed the 'Table1.Files.FileName' to
'tbxFileName' and on the forms ID's on click event I have theis code Igot from this forum
This is the code window
Option Compare Database
Private Sub ID_Click()
Dim strFilePath
With Me.RecordsetClone
.Bookmark = Me.Bookmark
strFilePath = "C:\Temp\" & Me.tbxFileName
If Dir(strFilePath) <> "" Then VBA.Kill strFilePath
![Table1.MyDocs.FileData].SaveToFile strFilePath
VBA.Shell "Explorer.exe " & Chr(34) & strFilePath & Chr(34), vbNormalFocus
End With
End Sub
when i click the id i get runtime error
'Item not found in this collection'
and this line in the code window is yellow '![Table1.MyDocs.FileData].SaveToFile strFilePath'
Can some one please help me to work this out especialy by 'Super Moderator' who made the code
I would apreciate any help
Thank you