Access Clear table data

Posted on 2009-04-30
Medium Priority
Last Modified: 2012-05-06
Dear Experts,

I am using Access 2003 &  have a command button in a form to clear out the data from the master table (this is a text field).  I have a piece of code I tried to adapt and the adapted version is this &

Private Sub Command55_Click()
Dim strSQL As String
strSQL = "UPDATE [tbl-master] SET Event1 = "
DoCmd.RunSQL strSQL
End Sub

I keep getting a run time error of 3144  syntax error in update statement. When I go into it the DoCmd.RunSQL strSQL piece is highlighted

Can anyone help
Question by:correlate
  • 3
LVL 120

Accepted Solution

Rey Obrero (Capricorn1) earned 2000 total points
ID: 24272396

what is the Data type of field Event1 ?

strSQL = "UPDATE [tbl-master] SET Event1 = ''"
DoCmd.RunSQL strSQL


strSQL = "UPDATE [tbl-master] SET Event1 = Null"
DoCmd.RunSQL strSQL
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24272410
sorry , i just saw  >>(this is a text field)
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24272422
so you just want to clear the field Event1 or are there any more conditions?

Author Closing Comment

ID: 31576555
Perfect - was a Text field thanks for your help

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question