如何在访问表单

时间:2016-11-15 11:32:34

标签: forms vba attachment access

抱歉英语不好

我创建了一个访问表单,我希望当用户点击搜索按钮时, 带有文本框值的相关图像显示在未绑定的附件中。

This is my table

and this is my Form

和访问表单中的代码

Private Sub Command_SearchCP_Click()

Me.Text_FullName = Nz(DLookup("Fa_Name", "User_Details", "PersonalCode =" & Forms!Frm_LeaveRequest!Text_CP), 0)
Me.Text_Section = Nz(DLookup("Section", "User_Details", "PersonalCode =" & Forms!Frm_LeaveRequest!Text_CP), 0)
Me.Text_SuperName = Nz(DLookup("SuperName", "User_Details", "PersonalCode =" & Forms!Frm_LeaveRequest!Text_CP), 0)
Me.ProfilePicture.ControlSource = Nz(DLookup("ProfilePicture", "User_Details", "PersonalCode =" & Forms!Frm_LeaveRequest!Text_CP), 0)

End Sub

感谢您的善意和帮助

0 个答案:

没有答案