If i want to add a new column or field in access table .
Here is the code
Sub add_new_colum_using_query()
DoCmd.SetWarnings (False)
' add new field or column name "New_Sales"
DoCmd.RunSQL "ALTER TABLE sales_detail ADD New_sales long "
' new_sales = sales *100 (multiple each slaes record with 100)
DoCmd.RunSQL "UPDATE sales_detail Set [New_sales] = [Sales]*100"
DoCmd.SetWarnings (True)
End Sub
Download Access Database
No comments:
Post a Comment