I'm stuck, bound and display column from SharePoint

lguzman

New member
Local time
Today, 23:27
Joined
Oct 13, 2015
Messages
4
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
 

Users who are viewing this thread

Back
Top Bottom