Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Putting a calculated value into a form field. 1

Status
Not open for further replies.

JamieF

Technical User
Dec 1, 2000
10
0
0
US
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.
 
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.
Or
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
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
 
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!
 
put the code
PriorityFactor = sum(status * rank * priority)

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


Mike Rohde
rohdem@marshallengines.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top