Solved

Calculated field value will not appear until I click another field

Posted on 2013-06-25
7
525 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
  • 3
  • 2
  • 2
7 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
Comment Utility
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
Comment Utility
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)
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 49

Expert Comment

by:Gustav Brock
Comment Utility
You could try with:

  Me.Dirty = False

to save the entry.

/gustav
0
 

Author Comment

by:SteveL13
Comment Utility
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)
Comment Utility
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 49

Accepted Solution

by:
Gustav Brock earned 500 total points
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
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…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now