?
Solved

Calculated field value will not appear until I click another field

Posted on 2013-06-25
7
Medium Priority
?
539 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
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
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
Independent Software Vendors: 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 51

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
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 51

Accepted Solution

by:
Gustav Brock earned 2000 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

800 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