Hi Jun 7
I followed your advice and its working .Thank you so much. what i did was created the table and module as adv. in the link. created another field "files" attacment. and created a query for multiple items. created a multiple item form. on the click event of id i put this code- It copies file path and file name to the table.
Code:
Private Sub FileID_Click()
'Usage example.
Dim strPath As String _
, strFileSpec As String _
, booIncludeSubfolders As Boolean
strPath = "C:\Data"
strFileSpec = "*.*"
booIncludeSubfolders = True
ListFilesToTable strPath, strFileSpec, booIncludeSubfolders
End Sub
Then on the click event of another field I put the code in post#7 - with a little change like this- Now if i click on a record it automatically attaches the apropriate file
Code:
Private Sub Attachment26_Click()
Dim db As DAO.Database
Dim rsParent As DAO.Recordset2
Dim rsChild As DAO.Recordset2
Set db = CurrentDb
Set rsParent = Me.Recordset
strFilePath = "C:\Data\" & Me.FName
rsParent.Edit
Set rsChild = rsParent.Fields("Files").Value
rsChild.AddNew
rsChild.Fields("FileData").LoadFromFile strFilePath
rsChild.Update
rsParent.Update
Exit_AddImage:
Set rsChild = Nothing
Set rsParent = Nothing
Exit Sub
Err_AddImage:
If Err = 3820 Then
MsgBox ("File already part of the multi-valued field!")
Resume Next
Else
MsgBox "Some Other Error occured!", Err.Number, Err.Description
Resume Exit_AddImage
End If
End Sub
So now all the parts are working seperately. so i am thinking using the code on a go to focus event and use macros to move around records. Thats how I am sending files to get saved in the folder in the first part.
What I am trying to do is "save some of the attachments in a record to a folder .delet them from table.bring back the deleted and saved files in the folder back to table in to another record.
well, Thank you very much. i 'll let you know the progress. if you hapen to ponder into a better and easy way please let me know. i wiill be checking the thread from time to time
Thanks for every one
thank you