Calculated textbox to table

Dscalf1

Registered User.
Local time
Today, 07:05
Joined
Jul 17, 2015
Messages
33
Hey,

I am trying to get a value from a textbox into a table I created...

The textbox "calculates a number based on which radio button is pressed example if radio button 1 is pressed it returns 0 if radio button two is pressed it returns 8 and if radio button 3 is pressed it returns 15." I need to save the 0,8, or 15 depending on which radio button is pressed into the table...

I know you arent supposed to store calculated values into a table but the report would never need to be changed and it just saves a new one each time with that being said anyway to make this work would be very helpful!

also how can you use the answer of calculated textboxs in other calculations? I guess im trying to do more excel things here in access and it isnt as easy at all...

Any help would be greatly appreciated!!
 
I can't see how you are calculating anything. You are just taking a user input and storing it.

Why don't you simply bind an Option Group of radio buttons to the relevant field and set the values to the ones you have given.

For other calculations please expand. Normally you use queries to do calculations. Or in forms you could use unbound text boxes to show calcs based on input boxes (but don't store them).
 
Im not really sure how else to explain it...

In one column the have the scoring option where you can click Target, Actionable, or Unacceptable. Then in the next column is the deductions and based on which radio button you clicked it returns a 0,8, or 15 by using this code: "=IIf([Frame1]=1,0,(IIf([Frame1]=2,8,(IIf([Frame1]=3,15,Null)))))" I inserted this code into the Control Source properties box so there is no where else to bind the deduction textbox to a table..

I need the form to store that deduction number (0,8,15) into the table that is already created..

I have tried to do a query for this but I didnt know how to get the query to return a number based on a different frame (option group) because I need it to show up on the form how many deductions it has..
 
I have tried to do a query for this but I didnt know how to get the query to return a number based on a different frame (option group) because I need it to show up on the form how many deductions it has..

It seems to me you are deep into Access trying to write code for "HOW" to do something, and you do not have a clear statement of "WHAT" you are trying to do.
If you can describe in simple English, business terms what you are trying to do, I'm sure you will get focused responses with options for how it may be accomplished.
 
I just explained it... Does that not make sense? The user is trying to score an item they have to click a button to show what score it received in multiple sections.. Which are the radio buttons. Then depending on what they choose it returns certain deductions i need to record those deductions in the table
 
Im really not understanding what isnt clear...

I dont want it done a certain anything that works would be great... Doing it through VBA or Binding the query that would work. anything.
 
Look at your post slightly differently.

Consider that the readers know nothing of you, your environment or your business.
To put it in a most simple analogy:

Think of readers like the person behind you in a fast food lineup. That person starts a conversation by saying what are you working on today? Now that person does not know you, has no idea what your business is, does not know database and has never heard of MSAccess. What would you say to him/her?
 
I work for a major baking manufacturer and they have to score bread daily to make sure it meets standards.

the user goes through a bunch of steps and then starts the scoring process based on criteria on the form

there are about 10 sections a loaf of bread is scored on each section has a good scoring an actionable scoring and a poor scoring

depending on which scoring is selected there are deductions from the final score

what im trying to do is store all of this into a table to use this data in analysis and compare it to different plants.

there are different columns the score column where the select the proper scoring, the deduction column that shows the proper deduction based on the scoring, and the score column that takes the total points that section is worth and subtracts the deductions from it

I need to store that final score for each section in a table

and then the final score that adds up each individual section to make the final score and store that as well..

I really wish I knew how to upload a picture so i could show you all.

And i dont mean to sound rude Im very grateful for all of your help. Because it seems like im the only one on the internet with this problem..
 
Last edited:
Nothing attached- no images.
 
I can't see how you are calculating anything. You are just taking a user input and storing it.

Why don't you simply bind an Option Group of radio buttons to the relevant field and set the values to the ones you have given.

For other calculations please expand. Normally you use queries to do calculations. Or in forms you could use unbound text boxes to show calcs based on input boxes (but don't store them).

I was using a IIf statement to give back a number is there another way to do this? I was unaware that I could set the values of option buttons to what I need them to be.
 
Your images didn't show up.

Is the field in the table/query that is bound the form? If it is then, put the following code in the After Update event of the option frame:
Code:
Me!FieldName = Me.NameOfTextboxThatDoesTheCalculation
... that's a rather long name ;)

It seems you already know that it's not ideal to save calculated values so I won't even ask why.
 
Hey! That's 1 for me and only 999 for you.
 
You're probably correct Tony. I've had more than 1 boss who never understood data management, let alone database. One, whose common observation was -- if we were more efficient, we wouldn't need as many people and I couldn't support my position. So his priorities were self-preservation based.

I like to get the OP to describe his/her situation/opportunity in simple English. Not only does this assist the reader with context and scope, but it also helps the OP to incorporate his/her thoughts for a meaningful, focused question.

Too often posters have an expectation that forum members have extra-sensory perception with a side of clairvoyance. There is an assumption that readers can read anything and make perfect sense of it. I like the OP to provide context and a question.
It's all part of --if you can't describe/define the issue, then nobody can build it.

The food line up is just a means to remove any assumptions. I have seen others --pretend you're talking to a 6 year old. Or -- pretend you are talking to someone who doesn't know your business.....
 
Last edited:
Why a four-year-old child could understand this report. Run out and find me a four-year-old child. I can't make head nor tail out of it." - Groucho Marx
 
No the form is bound to my results table and I do not want the user to enter the deductions that means they could enter less deductions than necesary.. Thats why it is important that the deductions is based on which button they push because the text box that shows the deductions will be locked and not editable..
 
I guess I am confusing everyone when I say calculated data... The only reason this is calculated is because I am using an IIf statement in the control source to spit out a number a different button is pressed...

So therefore instead of being able to bind the textbox to the form that IIf statement is in the control source box..

So while no actual calculations are done there is a formula in there..

And that is also why I can not create a query to just pull the calculated data because it is based on the buttons..
 
If it's another table that you want to update, create an Update Query that references the calculated value and use RunSql or Currentdb.Execute to fire the query.

Everyone else makes a good point about not saving calculated values though, but sometimes needs must.
 
My post came a bit late because I'm logged in from my phone.
 
I know youre not supposed to save calculated values i have read it everywhere... If anyone else could give a proper solution instead of saving it im all ears.
 

Users who are viewing this thread

Back
Top Bottom