MS VBA Access: How to Delete "One" Record in a Table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davidelloyd
    New Member
    • Aug 2008
    • 2

    MS VBA Access: How to Delete "One" Record in a Table

    I keep getting this error: "Syntax Error In From Clause."
    The below is my code. Could someone help.

    Private Sub Command26_Click ()
    DoCmd.RunSQL "DELETE * " & _
    "FROM Budget_Planner_ SubDatasheet" & _
    "CompanySto re = 'Begining Balance';"
    Last edited by davidelloyd; Aug 18 '08, 05:05 PM. Reason: Missing Quotation Marks
  • janders468
    Recognized Expert New Member
    • Mar 2008
    • 112

    #2
    You are not signifying your where clause as a where clause it should read:

    Code:
    DoCmd.RunSQL "DELETE * FROM Budget_Planner_SubDatasheet WHERE CompanyStore = 'Begining Balance';"

    Comment

    Working...