Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Join Date
    Jul 2004
    Posts
    8

    Exclamation Unanswered: Problem with percentages

    Ok,
    I'm building a small dbs, the problem I have is I need to subtract the percentage markup (12.5% on item) from the item total.
    I have tried many ways - but i'm no database expert.
    I have tried in Validation Rule and Default value, but I continually get a variety of abusive messages from access!
    Help would be greatly appriciated!
    Thanks

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Post

    If you do that in an Input form then do the next code in the EXIT event of your product value




    PHP Code:
      Private Sub txt_ProductValue_Exit(Cancel As Integer)
         
    txt_ValueAfterDeductiontxt_ProductValue - (12.5 txt_ProductValue/100)
      
    End Sub 

  3. #3
    Join Date
    Jul 2004
    Posts
    8
    Ok, n00b written across my head. Do you mean input box? Excuse my crapness

  4. #4
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Select item, (price - (price * 12.5/100)) As newPrice
    from tableA
    Last edited by r123456; 07-14-04 at 08:23.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  5. #5
    Join Date
    Jul 2004
    Posts
    8
    Good good, where do I write that, then?
    ?!?!

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Lightbulb

    No, I meant if you have a form on which you input your data. you should have a text box for the Article price and another one for the new price. Then put the code in the Exit event of the article price and you will get the new price after deduction....

  7. #7
    Join Date
    Jul 2004
    Posts
    8
    Uh - I'm just doing the tables atm o_0
    PricePerUnit Discount Total (after discount)
    7.99 12.5% ????
    Except something that I can like - copy and use over about 60 changes...

  8. #8
    Join Date
    Jul 2004
    Posts
    8
    PricePerUnit Discount Total (after discount)
    7.99_______12.5%__ ????

  9. #9
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Then make an Update Query to do that

  10. #10
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Thank You.
    Attached Files Attached Files
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  11. #11
    Join Date
    Jan 2004
    Location
    The Netherlands
    Posts
    421
    Dont store calculated results in a table ...

    Thats just about the 1st rule in DB design....

    Greetz

  12. #12
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Example using an UpdateQuery
    Attached Files Attached Files

  13. #13
    Join Date
    Jul 2004
    Posts
    8
    thanks - didnt know that. Once again I'm a n00b :P just learning...

  14. #14
    Join Date
    Jul 2004
    Posts
    8
    Thats what I have so far if people want to improve or criticise I'd be grateful (Constructive... Please!)
    Attached Files Attached Files

  15. #15
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Thank You.
    Attached Files Attached Files
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

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