Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    delete function (access 2000)

    Delete Function

    I seem to have a very old function for deleting my orders in the table Orders.
    I am afraid this function works nor more and i would like to ask can somebody suggest me a simplified and up to date code for deleting my orders by clicking the OrderID control on a form.
    My function is the following:
    PublicFunction DeleteOrders(ByVal strTableName As String,ByVal strWhere AsString)
    Dim strSQL AsString
    StrSQL = "DELETE * FROM (" strTableName & ") " & WHERE " & strWhere & ""
    CurrentDb,Execute strSQL

    and then i used to call the function like this:

    DeleteOrders" orders", "orders.orderid = " & Screen.ActiveControl.Value

    But then i receive he following message:

    Run time error 3320 :
    Function is not available in expressions in table-level validation expression.

    Can somebody help me in rewriting my function?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: delete function (access 2000)

    Try this:

    StrSQL = "DELETE * FROM " & strTableName & " WHERE " & strWhere
    Charlotte

Posting Permissions

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