Results 1 to 2 of 2
  1. #1
    tia is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Oct 2011
    Posts
    12

    Command Button

    I have 4 fields in a form:


    Actual Price
    Discount Rate
    Price Discount Value
    Price After Discount

    Scenario: The Actual price and Discount rate needs to be inputted manually.
    After typing the values in the actual price and discount rate, the customer needs to hit the Command Button named Calculate so that data will be displayed in the two other fields: Price Discount Value (Price Discount Value = Actual Price * Discount Rate) and Price After Discount (Price After Discount = Actual Price - Price Discount Value).

    What will I do so that once the customer clicks the Calculate button, the values in the Price Discount Value and Price After Discount will be displayed.

    What will I do in the on click event, what to choose (macro/expression or code buider)? What will I type?

    Thank You

  2. #2
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    I don't think you need a button. In the control source of your Discount Value control, put

    =nz([Actual Price],0) * nz([Discount Rate],0)

    In the control source of your After Discount control put

    =nz([Actual Price],0) - nz([Discount Value],0)
    Last edited by pdebaets; 11-20-2011 at 11:50 AM. Reason: added "nz"'s

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Command Button
    By BLD21 in forum Access
    Replies: 2
    Last Post: 05-02-2011, 04:47 PM
  2. Replies: 1
    Last Post: 07-27-2010, 02:27 PM
  3. Command Button
    By nashr1928 in forum Forms
    Replies: 2
    Last Post: 07-05-2010, 08:02 PM
  4. Command Button
    By nashr1928 in forum Forms
    Replies: 1
    Last Post: 07-05-2010, 07:05 PM
  5. Command Button
    By lannoe in forum Forms
    Replies: 1
    Last Post: 07-01-2010, 01:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums