Calculated textbox to table (1 Viewer)

Dscalf1

Registered User.
Local time
Today, 05:59
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!!
 

stopher

AWF VIP
Local time
Today, 13:59
Joined
Feb 1, 2006
Messages
2,395
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).
 

Dscalf1

Registered User.
Local time
Today, 05:59
Joined
Jul 17, 2015
Messages
33
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..
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:59
Joined
Jan 23, 2006
Messages
15,383
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.
 

Dscalf1

Registered User.
Local time
Today, 05:59
Joined
Jul 17, 2015
Messages
33
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
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 13:59
Joined
Jul 9, 2003
Messages
16,285
I think the real issue is although you have explained yourself quite well, what you are trying to do does not fit well with the way ms-access works.

This could be because you have a very particular issue to solve and you need to bend MS Access to your will. In other words you know exactly what you are doing and why.

Alternatively you have arrived at where you are by a process of trial and error and are trying to make the best of it.

Whichever of the above best fits it does appear that there may be a much simpler approach you could adopt.

In other words there is probably a normal regular way that is the accepted way of doing this and if you explain in more clarity what you are doing from beginning to end then we can point you to the accepted method and approach.

Now this might involve a bit of extra work for you in rejigging your database and you might decide to crack on and develop your own unique solution to your problem. And if you do well done, you will be learning a lot about MS Access. However you will also be developing your own solution and you may find it difficult to get help, not because no one wants to help you, but because your solution is unique.
 

Dscalf1

Registered User.
Local time
Today, 05:59
Joined
Jul 17, 2015
Messages
33
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.
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:59
Joined
Jan 23, 2006
Messages
15,383
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?
 

Dscalf1

Registered User.
Local time
Today, 05:59
Joined
Jul 17, 2015
Messages
33
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:

jdraw

Super Moderator
Staff member
Local time
Today, 08:59
Joined
Jan 23, 2006
Messages
15,383
Nothing attached- no images.
 

Dscalf1

Registered User.
Local time
Today, 05:59
Joined
Jul 17, 2015
Messages
33
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.
 

vbaInet

AWF VIP
Local time
Today, 13:59
Joined
Jan 22, 2010
Messages
26,374
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.
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:59
Joined
Jan 23, 2006
Messages
15,383
Hey! That's 1 for me and only 999 for you.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 13:59
Joined
Jul 9, 2003
Messages
16,285
Thank you for your excellent explanation. My Interpretation is that you have an unbound form (that is a form not attached to a table) and on that form you have several options groups and a text box. The text box is obviously unbound because the form is unbound. You want to use the option group selections made by the user to provide a calculated value for the text box.

You want to retain this value for future use and have decided the best way to do this is to save it to a table.

I would suggest that you do not need to save it to a table, all you need to do is attach your form to a table, there by making it a bound form. The textbox should be changed so that it is bound to the correct field in the underlying table. Any value placed in the text box will now be automatically stored in the forms table.

If that sounds correct to you, then we can move on to discuss how to create the calculation.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 13:59
Joined
Jul 9, 2003
Messages
16,285
person starts a conversation by saying what are you working on today? ----- What would you say to him/her?

"I'm an MS Access programmer" end of conversation they usually walk off and I never see them again! Occasionally Their Eyes glaze over and they go into a catatonic fit.
 

jdraw

Super Moderator
Staff member
Local time
Today, 08:59
Joined
Jan 23, 2006
Messages
15,383
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:

spikepl

Eledittingent Beliped
Local time
Today, 14:59
Joined
Nov 3, 2010
Messages
6,142
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
 

Dscalf1

Registered User.
Local time
Today, 05:59
Joined
Jul 17, 2015
Messages
33
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..
 

Users who are viewing this thread

Top Bottom