Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Discount on a form (access 2000)

    Let me tell you what i need to do,i stil do not know how to begin.I need to build a control on the form where i could write down percents.On entering the percent, the field Grossprice should be deducted with this percent.For exmple if grossprice is 100, i could play with entering different discounts and see quickly the results.Which is the best way to do it?

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Discount on a form (access 2000)

    You would need another control on the form, called NettPrice.

    In the After Update event for the Discount field put this code:

    me.NettPrice = me.GrossPrice * (1 - me.Discount/100)
    (if Discount is entered as a whole number e.g. 10 for 10%)

    or


    me.NettPrice = me.GrossPrice * (1 - me.Discount)
    if Discount is entered as a Percent 10% or Decimal .1
    Regards
    John



  3. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Discount on a form (access 2000)

    Thank you very much ! It works great !!
    Can i now update the result obtained in the control nettprice with the control grossprice? The form is based on the table products

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Discount on a form (access 2000)

    I am not sure that I follow what you are asking.

    If you don't use nettprice you could use

    me.GrossPrice = me.GrossPrice * (1 - me.Discount/100)

    but you will then lose the original value. If you change the discount, it will then give a second discount, rather than adjust the first discount.
    Regards
    John



Posting Permissions

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