Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006
    Posts
    42

    Unanswered: Delete with DLookup

    I have a form with not updatable controls. Can i however delete rows in the table referring to the control clicked on the form ? For example, in my form i have a productid = 76. Could i clicking this control delete the productid = 76 from the table products1 ?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    have a look at the docmd.runSQL command

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Yup.

    For example:

    Code:
    DoCmd.RunSQL "DELETE * FROM TableName WHERE ProductID = " & Me.ProductID
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •