How to update MsDataShape/NEW field in forms

W

Walter Guyer

Trying to update a virtual NEW field from a shaped (ADO-) recordset in forms
results in an error: "Field [fieldname] is based on an expression and cannot
be modified.
Similarly, on a virtual table from all NEW fields, forms does not allow for
any new records.
To be mentionned, updates and inserts (AddNew) in VBA works fine on the same
recordsets.

Does anyone knows of some options which might make forms to feed through
the updates/inserts?

Code used (example):
Private rst As New ADODB.Recordset
Private cnx As New ADODB.Connection
Private Sub Form_Load()
Const strSQL = "SHAPE TABLE Person_B " & _
" APPEND NEW adVarChar (32) AS Notes"
'Vaiation for a all virtual table
'Const strSQL = "SHAPE APPEND NEW adVarChar (32) AS Familyname, " & _
" NEW adVarChar (32) AS Notes"
cnx.Provider = "MSDataShape"
cnx.Open "Data Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & CurrentDb.name
rst.CursorLocation = adUseClient
rst.Open strSQL, cnx, adOpenForwardOnly, adLockOptimistic
Set Me.Recordset = rst
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top