Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Putting a calculated value into a form field.

Putting a calculated value into a form field.

Putting a calculated value into a form field.

I'm real beginner on creating Access forms. I've fumbled my way through most of it, but am stuck on how to get a calculated value to display onto the screen and also update into a field in the database.   Example:  Priority, Rank, and Status are all numeric fields entered by user.  PriorityFactor is the multiplied product of these three fields.  When a user enters or modifies a value in one of the three fields, I want the PriorityFactor to be re-calculated, displayed, and stored.  The PriorityFactor value can be 0.  Any and all suggestions greatly appreciated.  

RE: Putting a calculated value into a form field.

That's an age old problem with Access.
So to fix it, have the text box bound to the field
And then have the formula in an event such as the "On current" Event of the form.
Say you have a column of numbers that you enter in values.
Then after you key in the last value you want the total text box to show the total of all of the above.
So in the last text before the totals box put the formula in its "After_Update" event.
Then when you key in a value it will move out of it and trip the "After update" and your totals box will have the correct total and so will the table.

DougP, MCP
 Ask me how Bar-codes can help you be more productive.

RE: Putting a calculated value into a form field.

Thanks for the suggestions.  I guess I've left out a few details and/or I'm confused.   I have three fields on my form.  Each is numeric.  The valid choices for each are selected via a combo box pull-down list.  When any entry or change is made in any of these three fields, I would like a fourth database field to be updated with the product of the three and the total to display on the form.  I tried playing with the first of the three, but didn't find an "On Current Event" choice.  I was also not positive on how to properly create the expression so that the desired result was achieved.  What I want is for PriorityFactor = sum(status * rank * priority).  Again, suggestions are greatly appreciated!  

RE: Putting a calculated value into a form field.

put the code
PriorityFactor = sum(status * rank * priority)

on the 'after update' event of the first three combo boxes.  

Mike Rohde

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close