Solved

Calculated field value will not appear until I click another field

Posted on 2013-06-25
7
531 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 47

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 47

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
Technology Partners: 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 47

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

733 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