Follow these steps:
- Open the form in Design View.
- Right-Click the Discount field.
- Click on the Event tab and click the Build button of AfterUpdate property box (Figure B).
- Enter the following code at the prompt (Figure C):
Private Sub Discount_AfterUpdate()
[Discount Price] = [UnitPrice] * (1 - [Discount])
- Press Alt + Q.
Now, when a discount is entered in the Discount field, the Discount Price field will automatically update with the new price.
Miss an Access tip?
Check out the Microsoft Access archive and catch up on other Access tips.
Help users increase productivity by automatically signing up for TechRepublic's free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday.