Displaying Attachment data in Access Form using Attachment Field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nilanjangm
    New Member
    • Mar 2010
    • 11

    #1

    Displaying Attachment data in Access Form using Attachment Field

    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.

    Code:
    txtLastName = rs.Fields("Resource_Last_Name")
            txtFirstName = rs.Fields("Resource_First_Name")
            txtResourceCompany = rs.Fields("Resource_Company")
            txtResourceJobTitle = rs.Fields("Resource_Job_Title")
            txtStreetName = rs.Fields("Resource_Street")
    Now this is working fine except the "Attachment " record. The code is below.
    Code:
    attcResume.ControlSource = rs.Fields("Resource_Resume")
    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.
Working...