Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2010
    Posts
    26

    Delete SQL statement not working properly

    Hello,

    Another noob error from my part. I have a form that has a subform showing all the entries from tblContract. The sole function of this menu is to select and delete (with button OnClick() event) the records that are to be deleted.

    That being said, in my Event, I have followed the suggested SQL syntax, yet it gives me the run-time error 3078 "the microsoft jet database engine cannot find the input table or query '...(the query below)...'. Make sure it exists and that its name is spelled correctly." Here is the code:

    Code:
    Private Sub Command21_Click()


        
    Dim varResponse As Variant
     
        varResponse 
    MsgBox("Are you sure you want to delete?"vbYesNo"Selection")
        If 
    varResponse <> vbYes Then Exit Sub
        CurrentDb
    .Execute ("DETELE tblContract.* FROM tblContract WHERE tblContract.[pkContractID] =(" Me.frmContractConsult_Subform![pkContractID] & ")")
        
    Me.Refresh
     
    End Sub 
    Could there be a common error I'm doing? The name of the table is effectively "tblContract" and the primary key is "pkContractID".

    Thanks in advance,

  2. #2
    ConneXionLost's Avatar
    ConneXionLost is offline Simulacrum
    Windows XP Access 2003
    Join Date
    Jan 2010
    Location
    Victoria, Canada
    Posts
    291
    Did you check the spelling of the word "DELETE"?

    Cheers,

  3. #3
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    CurrentDb.Execute ("DETELE tblContract.* FROM tblContract WHERE tblContract.

    Please change DETELE to DELETE




    edit: I was late.

  4. #4
    Join Date
    Jul 2010
    Posts
    26
    LOOL

    Wow. Thanks guys. Would not have seen it myself. 1h down the drain for nada

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 26
    Last Post: 09-27-2010, 09:48 PM
  2. Textbox IIF statement not working
    By jgelpi16 in forum Forms
    Replies: 2
    Last Post: 08-22-2010, 08:41 PM
  3. Replies: 2
    Last Post: 06-14-2010, 09:38 PM
  4. Replies: 0
    Last Post: 04-08-2010, 12:22 PM
  5. Query on chart not working properly!
    By Sim_ in forum Queries
    Replies: 0
    Last Post: 10-28-2009, 09:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums