Add a calculated field to your Access form
Takeaway: Need to add a calculated field to an Access form? It's easy, and you can do it on the fly. Just add a new text box control with the appropriate formula as its control source.
If you are building an Access form based on a query and notice you will need to add a calculated field, you don't need to redesign your query -- just add the calculated field to your form. For example, say you are creating a form based on the Orders query, which consists of fields from the Orders and Order Details tables. You notice the query does not have a calculated field for the Total Purchase Price (Quantity*UnitPrice), which you want to appear on your form. Follow these steps to add a field for this calculation:
- Open the form based on the Orders query in Design Mode.
- Click the text box tool in the Database Toolbox.
- Click and drag in the form where you want to display the calculated field.
- Click and drag to select the Text Box Label and enter Total Purchase Price.
- Right-click the Unbound text box.
- Click Properties.
-
Under the Data
tab, click in the Control Source text box and enter the following formula:
=IIf(IsNull([Quantity]*[UnitPrice]),0,([Quantity]*[UnitPrice]))
As you enter orders into the form, the Total Purchase Price will display in the calculated field.
Miss a tip?
Check out the Microsoft Access archive, and catch up on our most recent 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.
Print/View all Posts Comments on this article
|
|
|
|
|
|
|
|
White Papers, Webcasts, and Downloads
- The Impact of Virtualization Software on Operating Environments VMware Today's use of virtualization technology allows IT professionals to ... Download Now
- Why Isn't Server Virtualization Saving Us More? A Few Small Changes May Dramatically Increase Your Efficiency VMware Ever wonder why your company isn't saving more from its server virtualization? Making a few small changes could dramatically increase your efficiency. Download Now
- Email Security and Archiving - Clearer in the Cloud Google The time is NOW for businesses and organizations of all sizes to implement ... Download Now
- The Scalable Enterprise: VMware ESX Server on the Dell PowerEdge 6650 Dell This paper introduces the server virtualization software, VMware ESX ... Download Now
- VMware Infrastructure: A Guide to Bottom-Line Benefits VMware Frustrated by the high cost of maintaining or building ever-larger data centers? Get the facts you need to formulate your Virtualization Action Plan. Download Now
Article Categories
- Security
- Security Solutions, IT Locksmith
- Networking and Communications
- E-mail Administration NetNote, Cisco Routers and Switches
- CIO and IT Management
- Project Management, CIO Issues, Strategies that Scale
- Desktops, Laptops & OS
- Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
- Data Management
- Oracle, SQL Server
- Servers
- Windows NT, Linux NetNote, Windows Server 2003
- Career Development
- Geek Trivia
- Software/Web Development
- Web Development Zone, Visual Basic, .NET

