Solved

Ms Access Auto populating a field based on a value on a form

Posted on 2014-09-08
1
320 Views
Last Modified: 2014-09-18
I have several fields on a form:
Price = [user enters and it is added to a table]
Qty = 19 (user enters)
each price = $.0489 (user enters)

total price:  $9.291 (calculation on the form based on [qty]*[each price]

the user can enter a qty and a each price which would give them a total price.  How do I get the total price to populate in the Price field?  The price is populated with default values or the user can overwrite the default value)
0
Comment
Question by:deefel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 37

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40310890
As long as you keep the UnitPrice and the quantity, there is no need to keep the ExtendedPrice.  It is far better practice to calculate it in the query.  Doing the calculation in the query will also automatically populate the ExtendedPrice field on the form.  
Select ..., UnitPrice, Quantity, UnitPrice * Quantity AS ExtendedPrice
From ...;

If you insist on doing this in the form (against expert advice) then you have to worry about when to do the calculation.  You either have to do it in both the AfterUpdate event of the UnitPrice and Quantity fields or you would do it in the BeforeUpdate event of the Form.

Me.txtExtendedPrice = Me.txtUnitPrice * Me.txtQuantity
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question