Hello,
I hope there's a guru that can help me out.
I have a query that gets contacts' data (emails) from a list in SP. One of the fields is a multivalued filed with several email addresses.
When I run the query from the design view it works. It shows the emails though the field is actually bound to the PK in the SP list.
The problem comes when I create a recordset in VBA (to populate several emails). The recordset gets created (recordcount gives the right number of records), but when I call the values I get an error. I'm afraid there's something going on when fetching the data from SP. I get the error "3420 Object invalid or no longer set".
As I said the query runs ok from the design screen and the recordset gets created but I can't pull the display field from VBA.
++++
Set dbs = CurrentDb
Set rs = dbs.OpenRecordset("myquery", dbOpenSnapshot)
'Goes thru data
rs.MoveLast
rs.Fields.Refresh
rs.MoveFirst
'Prepares the email
MyToline = rs("Main").Value 'here the error
MyCCLine = rs("CopyStaff").Value 'here the error
++++
Any way out?
Thank you very much
lg
I hope there's a guru that can help me out.
I have a query that gets contacts' data (emails) from a list in SP. One of the fields is a multivalued filed with several email addresses.
When I run the query from the design view it works. It shows the emails though the field is actually bound to the PK in the SP list.
The problem comes when I create a recordset in VBA (to populate several emails). The recordset gets created (recordcount gives the right number of records), but when I call the values I get an error. I'm afraid there's something going on when fetching the data from SP. I get the error "3420 Object invalid or no longer set".
As I said the query runs ok from the design screen and the recordset gets created but I can't pull the display field from VBA.
++++
Set dbs = CurrentDb
Set rs = dbs.OpenRecordset("myquery", dbOpenSnapshot)
'Goes thru data
rs.MoveLast
rs.Fields.Refresh
rs.MoveFirst
'Prepares the email
MyToline = rs("Main").Value 'here the error
MyCCLine = rs("CopyStaff").Value 'here the error
++++
Any way out?
Thank you very much
lg