You can add an Attachment though code via RecordSets.
Something like this
Is there another way to attach a file to an attachment data type field without using RecordSets?
Maybe something like
With lots of records I find looping though RecordSets slows down the program.
Thanks.
Something like this
Code:
Dim MyRECORDSET As DOA.Recordset
Dim NumberOfRecords As Integer
Dim MyCounter as Integer
Set MyRECORDSET to Currentdb.OpenRecordset("MyTable")
NumberOfRecords = DCount("EmployeNumberPK","MyTable")
MyCounter = 0
MyRECORDSET.MoveFirst
For MyCounter = 1 to NumberOfRecords
MyRECORDSET.Edit
If MyRECORDSET("EmployeNumberPK") = Me.EmployeeNumberPK Then
MyRECORDSET("EmployeePicture").LoadFile "C:\EmployeePictures\" & Me.EmployeeNumberPK & ".jpg"
End If
MyRECORDSET.Update
Next
Maybe something like
Code:
Me.EmployeePicture.Value = "C:\EmployeePictures\" & Me.EmployeeNumberPK & ".jpg"
Thanks.
Comment