Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    114
    Thanks
    0
    Thanked 0 Times in 0 Posts

    functio to be used in 3 forms (Access 2000)

    Function to be used in 3 forms

    Can somebody help me to set up a function that could be used in different forms, i cannot find the way. I have tried
    to build the following function putting " frm" in brackets and then i put in the OnClick event CancelOrder(Me.Name)
    but i receive the message that the object is not known.I cite below just part of the code,in order to see my problem.


    Public Function CancelOrder(frm As form)
    strSQL = "DELETE * FROM Orders WHERE orderID = " & frm!OrderID & ";"
    DoCmd.RunSQL strSQL
    strSQL = "DELETE * FROM [order details] WHERE orderID = " & frm!OrderID & ";"
    DoCmd.RunSQL strSQL
    End Function

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: functio to be used in 3 forms (Access 2000)

    The argument frm is a form, not a string. Use

    CancelOrder(Me)

    instead.

Posting Permissions

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