Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

fjdurbin

Technical User
Dec 14, 2010
2
0
0
US

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:

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

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

This line of code does not work:

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

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

Code:
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top