Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2007
    Location
    Global Village
    Posts
    185

    Unhappy Unanswered: Attachment field in Unbound Form problem

    Hi,
    In fact I raised this problem in the following thread few days ago but I got no answer and I think I didn't open the problem very well cuz my English is not good enough

    http://www.dbforums.com/showthread.php?t=1630484

    Here I explain the problem, If you need more details let me know plz.
    I use 2007 edition and as you know there is an attachment filed which is new
    The attachment field works fine until you use an Unbound form.
    I have an Unbound form and it pull the data from back-end tables using ADO with Normal SELECT query.
    I do assign each control in my form to the related value in the recordset returned by ADO code
    everything works fine without assigning the attachment data to the attachment control in the form but when I do so it return the following error:

    Error438 object doesn't support this property or method

    My code for assigning the data is one of the two methods in follow:

    Code:
    Me!Attachment147 = objRST![Document file]
    'or
    Me.Attachment147 = objRST.Fields("Document file")
    Thanx for your help in advance
    <<Never Walk on the Traveled Path, Because it only Leads you to where the Others have been.>>
    Graham Bell

  2. #2
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Welcome to Microsoft Gimmickry.

    Since an attachment field object can attach a number of files to a record, the syntax is wrong. An attachment field is effectively an internal array handled by Access.

    I don't know exactly how to add an attachment to an attachment field yet since I have completely avoided using it since it is an Access2007 specific component and I tend to use only those things that are compatible with previous versions of Access.

    Take a look at the properties and methods available to the attachment field object through VBA (such as .FileName, .FileType and .FileURL) and the solution might present itself.

    Edit: 2 minutes on Google give me this:

    http://blogs.msdn.com/access/archive...ent-field.aspx
    http://blogs.msdn.com/access/archive...cess-2007.aspx

    I'm sure you'll find the solution now
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  3. #3
    Join Date
    Sep 2007
    Location
    Global Village
    Posts
    185
    Thanx for your kind help Star,
    tbh I already read those links, but there is a big problem in 2007 edition which is: DAO is no longer available for access to external files (i.e back_end file) and in that method used in those links it uses DAO with Recordset2 & Field2 (as it support multi valued field type that I need )which is not supported in ADO.
    I hope to find a solution for this, I posted the same thread in Microsoft Discussion group few days ago but I'm sure they are not better than our forum and got no answer up to now.
    I solved the problem just temporarily by using a bound subform in my Unbound form with those Attachments, but I don't like such tricks, I believe with this trick the form really doesn't has the Unbound form quality.
    Finally I was thinking to uninstall 2007 edition and use 2003 as everything in 2003 is much more better and seems to me perfect.
    <<Never Walk on the Traveled Path, Because it only Leads you to where the Others have been.>>
    Graham Bell

  4. #4
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I was thinking to uninstall 2007 edition and use 2003 as everything in 2003 is much more better and seems to me perfect.
    Sounds like a good idea to me, but it isn't going to solve the problem since 2003 doesn't support the attachment field type. I tend to only develop stuff in 2007 that is available in 2003, so personally I wouldn't be using the attachment data type anyway.

    IMO, 2003 is a superior product by far and I have deep concerns about the future of Access, judging by the direction Access 2007 has taken.... but that's another topic.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •