.Update

  • Thread starter Thread starter Molly
  • Start date Start date
M

Molly

What is the proper format of the .Update code?

I've tried:

Me!txtPrintData = Null
With rst
.Edit
!printData = Me!txtPrintData
.Update ,True
End With
and end up with a runtiime error. I need to update a field in a table
without access message 'Write Conflict'

TIA
Molly
 
Molly,

Your recordset approach is wrong!

If you are trying to set the field, txtPrintData, in the current record to Null,
all you need in your code is:
Me!txtPrintData = Null

If you are trying to set the field, txtPrintData, in all the records in your
table to Null, then you need to execute an update query. Create a query named
MyUpdateQuery based on the table containing the field, txtPrintData. Just
pulldown into the query grid, txtPrintData. Click on the query type button on
the toolbar and change the query to an update query. Where it says Update To
under txtPrintData, enter Null. Use this code to run the query:

DoCmd.SetWarnings False
DoCmd.OpenQuery "MyUpdateQuery"
DoCmd.SetWarnings True
 
Back
Top