Access Clear table data

Posted on 2009-04-30
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
    LVL 119

    Accepted Solution


    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 119

    Expert Comment

    by:Rey Obrero
    sorry , i just saw  >>(this is a text field)
    LVL 119

    Expert Comment

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

    Author Closing Comment

    Perfect - was a Text field thanks for your help

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

    734 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now