我在MS Access中有一个代码,用于将附件值放入表单中“附件”框的字段中。但是使用我的代码,会发生错误3265:
Function Attachment_show()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
With Me.Recordset
.MoveFirst
Do While Not .EOF
Dim IDD As String
IDD = Me.ID.Value
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT Tbl_Header.* FROM Tbl_Header WHERE
(((Tbl_Header.ID)= " & IDD & "));")
If rs.RecordCount > 0 Then
Me![Attachment] = rs("Attacment").Value --> Error 3265
End If
.MoveNext
Loop
End With
End Function
请帮助我解决此问题
答案 0 :(得分:0)
也许您错过了一封信?试试
rs("Attachment").Value