Quantcast
Channel: SharePoint 2013 - General Discussions and Questions forum
Viewing all articles
Browse latest Browse all 26374

Can you add comments to an append-only field in a Sharepoint list using Access2010?

$
0
0

I can use the following connection string to write to all fields but not the field [Actions Taken] field that is Append Only with Versioning turned on:

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = Application.CurrentProject.Connection
Set rs = New ADODB.Recordset
Dim strRS As String
strRS = "SELECT qryJD_SRs.* FROM qryJD_SRs WHERE qryJD_SRs.ID=" & Me.ID

rs.Open strRS, cn, adOpenKeyset, adLockOptimistic
This line of code works to write data to a field:

rs.Fields("Details").Value = "Test Details Field" 

This line of code does not work:

rs.Fields("Actions Taken").Value = "Test Actions Taken Field"

Both the [Details] and the [Actions Taken] fields are Memo and Rich Text. The [Actions Taken] field is Append Only = Yes

If I use DAO the following will write data to a field:

Private Sub addNewAction_Click()
Dim rs As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT * FROM [Service Requests] WHERE [Service Requests].ID = " & Me.ID
Set rs = DBEngine(0)(0).OpenRecordset(strSQL, dbOpenDynaset)

With rs
.Edit
![Details] = "Monday test"
.Update
End With

rs.Close
Set rs = Nothing
End Sub

Unfortunately, this DAO below will NOT write data to the Append Only field:

Private Sub addNewAction_Click()
Dim rs As DAO.Recordset
Dim strSQL As String
strSQL = "SELECT * FROM [Service Requests] WHERE [Service Requests].ID = " & Me.ID
Set rs = DBEngine(0)(0).OpenRecordset(strSQL, dbOpenDynaset)

With rs
.Edit
![Actions Taken] = "Monday test"
.Update
End With

rs.Close
Set rs = Nothing
End Sub

Any suggestions?...JD


JohnDurbin


Viewing all articles
Browse latest Browse all 26374

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>