Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    On Current (Access 2000)

    I want to use the OnCurrent event to calculate the end price for each product hoever i receive an error "Member already exists in an object module from which the object modules derives.How can i clear my mistake ? I am sending the attachement

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

    Re: On Current (Access 2000)

    EndPrice is the name of a field in the record source of the form. You can't define a function of the same name in the form module. You could use

    Private Sub Form_Current()
    Me![tendprice] = CalcEndPrice(grossprice)
    End Sub

    Private Function CalcEndPrice(grossprice)
    CalcEndPrice = grossprice * 1.2
    End Function

    But I wouldn't do it this way - it means that each record will be modified each time you visit it, even if you don't change anything yourself. I would either make EndPrice a calculated field, or use the After Update event of grossprice to set EndPrice.

  3. #3
    2 Star Lounger
    Join Date
    Mar 2006
    Posts
    195
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: On Current (Access 2000)

    Thank you ,Hans ! It was very important for me.

    kind regards

Posting Permissions

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