Q: How do you change the default size for a recordset text field? When the recordset is created, the fields are set 50 characters long. I can see the setting in the Locals Window but nothing I do seems to change it. If, for instance, OldValue is greater than 50 characters long, I get a “Run-Time error 3161, The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.” I tried to change Tools, Options, Tables/Queries, Default Field sizes to a larger number but that doesn’t change the property as seen in the locals window. Thanks
Sub UpdateTempRST(txtA, txtFieldName, OldValue, NewValue)
Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase("MyTable"
Set rs = db.OpenRecordset("MyTempTable"
rs.AddNew
rs!FieldA = txtA
rs!FieldName = txtFieldName
rs!Old = OldValue
rs!New = NewValue
rs.Update
rs.Close
db.Close
End Sub
Sub UpdateTempRST(txtA, txtFieldName, OldValue, NewValue)
Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase("MyTable"
Set rs = db.OpenRecordset("MyTempTable"
rs.AddNew
rs!FieldA = txtA
rs!FieldName = txtFieldName
rs!Old = OldValue
rs!New = NewValue
rs.Update
rs.Close
db.Close
End Sub