Solved

Calculated field value will not appear until I click another field

Posted on 2013-06-25
7
537 Views
Last Modified: 2013-06-26
I have a field on a form which is a calculated field.  The name of the field is "txtDraw1Interest"  The calculation is:

=([txtDraw1Amount]*[txtDraw1DaysOut])*[txtIntRateLoan]/100

But the calculated value isn't showing up in the field until I click on another field anywhere on the form.

I've tried an after update event on the last field data is entered into, "txtDraw1Date".  The code I tried is:

    Me.txtDraw1Interest.Requery

But it doesn't work.  I also tried it in a beforeupdate event.

????
0
Comment
Question by:SteveL13
[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
  • 3
  • 2
  • 2
7 Comments
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 39275032
If you are typing in the control (txtDraw1Date), then you are not changing the value, you are changing the text property of that control.  The "Value" of that control will not actually change until you leave that control via (Enter, Tab, or some click event outside of that control).
0
 

Author Comment

by:SteveL13
ID: 39275093
I am tabbing off the date field and Me.txtDraw1Interest is not updating until I click on another field.  So I wonder why tabbing off the date field isn't working?
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 39275145
On closer look, I see that the code in your control source does not reference txtDraw1Date, so what do you expect to happen?

Is one of the controls referenced in your statement:

=([txtDraw1Amount]*[txtDraw1DaysOut])*[txtIntRateLoan]/100

influenced by the data in txtDraw1Date?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 50

Expert Comment

by:Gustav Brock
ID: 39275146
You could try with:

  Me.Dirty = False

to save the entry.

/gustav
0
 

Author Comment

by:SteveL13
ID: 39275212
The formula:

=([txtDraw1Amount]*[txtDraw1DaysOut])*[txtIntRateLoan]/100

Is the control source for

txtDraw1Interest

The event I have it in right now is in the afterupdate event of:

txtDraw1Date
0
 
LVL 48

Expert Comment

by:Dale Fye (Access MVP)
ID: 39275244
But none of those fields have anything to do with txtDraw1Date?

Why would you expect the value to txtDraw1Interest to change if you make a change in txtDraw1Date?  That field (txtDraw1Interest) is only going to change if you change the value of one of the following controls:

txtDraw1Amount
txtDraw1DaysOut
txtIntRateLoan
0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 39275307
The AfterUpdate event of txtDraw1Date will never fire.

AfterUpdate is related to user input, Thus - if at all needed - you should recalc/requery at the AfterUpdate event of the other textboxes.

/gustav
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

690 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