View Full Version : Help with text boxes on a report.


odin1701
02-05-2008, 07:39 AM
I have a text box on my form.

What I need to do is grab the value from another text box on the form and put it in this one so that it gets stored in the table.

So I have the following two text boxes:

txtEvalScore and txtEvaluationScore

txtEvaluationScore does some math calculations with some of the other fields, and displays a score.

I need to copy this score and put it into txtEvalScore, which has it's data source set to a field in my table.

With forms I'm used to just doing txtEvalScore.Value, but with reports this doesn't work. Is there any way to do this?

Your help is appreciated. Thanks!

Brianwarnock
02-05-2008, 07:50 AM
You should not store a value that can be calculated from existing data in a table, I get the impression that you are doing this because you cannot get that value into the report!

=Forms!formname!txtevaluationScore would do it if the form is open which presumeably it would be.

Or have I missed the point.

Brian

odin1701
02-05-2008, 08:01 AM
Yeah there is no form with this data at all.

I need to store the value because it is not calculated from a single table, but multiple tables and this report is the only thing that brings them all together.

It's a stupidly designed database but I have to try to fix the thing so it can do what it's supposed to do. The thing was designed from the ground up to be a pass/fail system but we want to use an actual score. It's ridiculous but anyway.

Brianwarnock
02-05-2008, 08:17 AM
Well I guess in the afterupdate event of txtEvaluationScore you could put Me.txtEvalScore=Me.txtEvaluationScore

Brian

odin1701
02-05-2008, 08:21 AM
I've tried putting Me.txtEvalScore = Me.txtEvaluationScore in the on close event. It doesn't work.

I get an error of "You cannot assign a value to this object."

Brianwarnock
02-05-2008, 08:43 AM
True, but what happened when you did it in the txtevaluationscore afterupdate event as suggested?

Brian

odin1701
02-05-2008, 09:13 AM
I got it - I had to create a global variable for the ID of the evaluation and have every freaking procedure used to create new evals set this variable to the ID, then I used a SQL statement in the on close event to update that particular record, and it's working. PITA, but it's working.

I am going to find whoever designed this thing and hurt them haha.

Brianwarnock
02-05-2008, 10:13 AM
Thanks for coming back, sounds more convoluted than at 1st, glad its working.

Brian