How do I clear the same field in every record all at once in Acces

W

wurstfreund

That's about it. I know there's got to be a way to do this, but I'm just
starting and don't know how.
I just want to be able to click a button and clear all of one field in every
record.
 
C

chris.nebinger

On the OnClick event:


DoCmd.RunSQL "Update [TableName] Set [FieldName]=Null"
 
A

Allen Browne

Use an Update query.

If you want to do it programmatically, it will be something like this:

dbEngine(0)(0).Execute "UPDATE Table1 SET Field1 = Null WHERE Field1 Is Not
Null;", dbFailOnError
 
Top