0
Hellooooooooooooooooすべての私の友人 追加添付ファイルデータVBA
私は私のテーブルにアタッチ追加するためにそのコードを使用して、それがverry良い Dim rsEmployees As DAO.Recordset
Set db = CurrentDb
Set rsEmployees = db.OpenRecordset("FileAttach")
Dim rsPictures As Object
Dim x As Integer
' Activate edit mode.
rsEmployees.AddNew
' Instantiate the child recordset.
Set rsPictures = rsEmployees.Fields("AttachForms").Value
rsPictures.AddNew
' Add a new attachment.
rsPictures.Fields("FileData").LoadFromFile "C:\Users\xmen5\Desktop\fl1.rar"
rsPictures.Update
' Update the parent record
rsEmployees.Update
Next
を働いたとのxに使用する方法私のプロンプラムは、そのコードでxに使用するときです。
Dim rsEmployees As DAO.Recordset
Set db = CurrentDb
Set rsEmployees = db.OpenRecordset("FileAttach")
Dim rsPictures As Object
Dim x As Integer
' Activate edit mode.
rsEmployees.AddNew
' Instantiate the child recordset.
Set rsPictures = rsEmployees.Fields("AttachForms").Value
For x = 1 To DCount("*", "[Attchment]")
rsPictures.AddNew
' Add a new attachment.
rsPictures.Fields("FileData").LoadFromFile DLookup("[PathTxt]", "[Attchment]", "[id]=" & x & "")
rsPictures.Update
' Update the parent record
rsEmployees.Update
Next
それは私にそのエラー enter image description here
私はテーブル から添付ファイルのパスを取るを与えるので、私はそのコードとxに対して
ありがとうございました私の友人moreeeeeeeeeその仕事は良い –
どのように私はあなたの答えは最高の答えですか? –
素晴らしい!答えをマークし、上三角をクリックしてください。 – Gustav