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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

With a calculation in a text box's control source, how can I bind it t 1

Status
Not open for further replies.

Patentinv

Technical User
Aug 26, 2005
84
US
Hi,
I have a text box called (TOTFLDSQ) in its control source I have a calculation =[txtfld]+[Xtrasqrs], Is there a way to have the sum of this total be saved in a field in the forms bound table?

If the calculation was not in the control source I could bind this text box to a field in the forms bound table, But I need to have the sum value of this calculation show in this text box, but I also need to use the sum value in a different form.
So if I could save this value in a table i could call it in other forms.


Thanks--all help w/be very much appreciated.
 
How are ya Patentinv . . .

Just be sure to [blue]include the bound field in the forms record source[/blue]. It doesn't have to be on the form but should appear in the forms [blue]field list[/blue]
FieldList.BMP
.

Then in the [blue]BeforeUpdate[/blue] event of the form:
Code:
[blue]   Me!BoundCtlName = Me!CalculatedCtlName[/blue]

BTW . . . calculations are not usually stored in a table . . .

Calvin.gif
See Ya! . . . . . .
 
I would attach a macro to the On Exit event of Xtrasqrs that sets the value of TOTFLDSQ to [txtfld]+[Xtrasqrs]

 
Hi Aceman1,
I'm doing good now that you have solved another one of my problems, how about your self?

I don't know if it is me or you that has been desiging this
DB? Every time i get my self in a corner you always come up with an awesome solution to make my day/week. I can't thank you enough. Your the best programmer I've came across.

Now I can use these values through out my database in all forms. I was really stuck. Thank you very much.

With out your help, I don't know what I'd do.

I really appreciate all your help.


 
Patentinv . . .

On behalf of [blue]all the other great guru's[/blue] we have hear at Tek-Tips . . .

[purple]Thank You . . .[/purple]

Calvin.gif
See Ya! . . . . . .
 
Aceman1, and all the other great guru's at Tek-Tips Thanks for all your help, with out Tek-Tips and all your guys help,
I don't know what I'd do.

 
I would also like you to read this Fundamentals of Relational Database Design as what you're doing here, it seems you're storing values that can be derived from other fields, violates the principles of relational databases. This should only be done if one really, really, really knows what one is doing.

You should really calculate the value each time you need it, in stead, as storing it will allow for it to come out of sync with the values it is derived from ...

Roy-Vidar
 
Hi RoyVidar,
Thanks for the concern, unfortunatly I have know choice but to do it this way.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top