appending OLE Object from one table to another in msaccess table error

error  is an expression you entered is the wrong data type for one of the arguments
the code below is what i am using, the code that updates the all the other fields works well
but when it comes to the picture from one table to the other,
both are of the type OLE Object
and one is spelt picture and the other is spelt pciture  its just a spelling fault when i built the table
but this bit of code throws up the error
---
  DoCmd.RunSQL " INSERT INTO tbldatedatehour (picture)" & _
              " VALUES ('" & rs![Pciture] & "')"
----

  Dim str As String
           
           Dim cn As ADODB.Connection
           Dim rs As ADODB.Recordset
           Set cn = CurrentProject.AccessConnection
            Set rs = New ADODB.Recordset
           Sqlval = "SELECT * " & _
                       " FROM tblPropertieViewing " & _
                       " WHERE (((tblPropertieViewing.ID)=" & FndID & "))"
            With rs
             Set .ActiveConnection = cn
             .Source = Sqlval
             .LockType = adLockOptimistic
             .CursorType = adOpenKeyset
             .Open
          End With
         
          ' ADD THE REC TO THE TABLE THE DATA FROM THE tblPropertieViewing
         
           DoCmd.RunSQL " INSERT INTO tbldatedatehour (picture)" & _
              " VALUES ('" & rs![Pciture] & "')"

any help would be appreciated
sydneyguyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Surone1Commented:
ole objects are difficult to handle and most people i know advise against storing picture data in a database rather than links to the pictures.

if you do need to doit. the following method does work.

     Dim rs As ADODB.Recordset
           Set cn = CurrentProject.AccessConnection
            Set rs = New ADODB.Recordset
               Sqlval = "SELECT * " & _
                       " FROM tblPropertieViewing " & _
                       " WHERE (((tblPropertieViewing.ID)=" & FndID & "))"
            With rs
             Set .ActiveConnection = cn
             .Source = Sqlval
             .LockType = adLockOptimistic
             .CursorType = adOpenKeyset
             .Open
          End With
         
           Dim rs2 As ADODB.Recordset
           Set cn2 = CurrentProject.AccessConnection
            Set rs2 = New ADODB.Recordset
           Sqlval2 = "SELECT * " & " FROM tbldatedatehour"
            With rs2
             Set .ActiveConnection = cn2
             .Source = Sqlval2
             .LockType = adLockOptimistic
             .CursorType = adOpenKeyset
             .Open
                rs2.AddNew
        rs2![picture] = rs![Pciture]
             rs2.Update
          End With
         
         rs.Close
         rs2.Close
         Set rs = Nothing
         
         Set rs2 = Nothing
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sydneyguyAuthor Commented:
thanks for this will have a go at the code, i usually do not store in side data base but there only thumbnail pics and for speed am placing them in the db so will return soon thanks so far
1
sydneyguyAuthor Commented:
few little mods and it works just fine
it just pulls the images into a daily report and then moves on thenks for the help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.