?
Solved

Access Clear table data

Posted on 2009-04-30
4
Medium Priority
?
504 Views
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
Me.Refresh
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
0
Comment
Question by:correlate
  • 3
4 Comments
 
LVL 120

Accepted Solution

by:
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

or

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

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 24272410
sorry , i just saw  >>(this is a text field)
0
 
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?
0
 

Author Closing Comment

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

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