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:
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.
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.>>
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.