Pages

Tuesday, December 27, 2011

Delete a Field or Column Using DAO

If you want to delete the field or column in the table.

Here is the code-

Sub delete_column_using_DAO()
DoCmd.SetWarnings (False)
On Error Resume Next
' CLOSE THE TABLE IF ITS OPEN
DoCmd.Close acTable, "SALES_DETAIL", acSaveYes
' delete the field S_No
CurrentDb.TableDefs("sales_detail").Fields.Delete "S_No"
DoCmd.SetWarnings (True)
End Sub


Download Access Database

No comments:

Post a Comment