By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 2,763 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

Displaying Attachment data in Access Form using Attachment Field

P: 11
I am using MS Access 2007.

I have one of my tables where I store files as "Attachment" datatype against each employee record. Till this point everything is okay.

Now, what I want is to display in the form is on selecting an employee (I'm using a combo box to populate all the employees), I want to display all corresponding records from the table on the form. All other details are displayed fine except the "Attachment" record.

What I have done is used a "SELECT" query to get all records of the selected employee and populate it in a "Recordset". Then I displayed on the form like this.

Expand|Select|Wrap|Line Numbers
  1. txtLastName = rs.Fields("Resource_Last_Name")
  2.         txtFirstName = rs.Fields("Resource_First_Name")
  3.         txtResourceCompany = rs.Fields("Resource_Company")
  4.         txtResourceJobTitle = rs.Fields("Resource_Job_Title")
  5.         txtStreetName = rs.Fields("Resource_Street")
  6.  
Now this is working fine except the "Attachment" record. The code is below.
Expand|Select|Wrap|Line Numbers
  1. attcResume.ControlSource = rs.Fields("Resource_Resume")
  2.  
This line of code produced this error.
Run-time error '13':

Type mismatch
I am a bit stuck on ideas over this. Any idea?

Thanks in advance.
Apr 7 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.