From: Cbeckwith on 29 Apr 2010 13:18 I have a text box (called ExtendedCost), that has a sum statement in it. I want to copy the value on the exit control event to another text box control (called WithdrawlAmount) on the same form and write the value into WithdrawlAmount box on the Enter Event for the control box, so people don't have to input the same number into the control box. Is there an easy way to do this?
From: BruceM via AccessMonster.com on 29 Apr 2010 13:38 If it's the same calculated value, just use the same expression. Generally, don't store calculated values. Just perform the calculation as needed. If you need more help with this, describe in more detail what you are doing. What is the "sum statement"? Is WithdrawalAmount a bound text box? I ask because you mention writing the value to the text box, not to the table. Cbeckwith wrote: >I have a text box (called ExtendedCost), that has a sum statement in it. I >want to copy the value on the exit control event to another text box control >(called WithdrawlAmount) on the same form and write the value into >WithdrawlAmount box on the Enter Event for the control box, so people don't >have to input the same number into the control box. Is there an easy way to >do this? -- Message posted via http://www.accessmonster.com
From: Jeff Boyce on 29 Apr 2010 13:42 First a caution ... You're describing copying the contents of one control into one/more other controls. As long as you aren't trying to SAVE the value in multiple fields in underlying table(s), no worries. That is, all those other controls would be unbound... In the AfterUpdate event, or the OnExit event from your first control, you could use something like (untested): Me!YourSecondControl = Me!YourFirstControl Me!YourThirdControl = Me!YourFirstControl Me!Your... If, however, your other controls are bound to underlying fields in tables, then reconsider. If you already know/have stored the value one time, what rationale are you using to store it repeatedly? Good luck! Regards Jeff Boyce Microsoft Access MVP -- Disclaimer: This author may have received products and services mentioned in this post. Mention and/or description of a product or service herein does not constitute endorsement thereof. Any code or pseudocode included in this post is offered "as is", with no guarantee as to suitability. You can thank the FTC of the USA for making this disclaimer possible/necessary. "Cbeckwith" <Cbeckwith(a)discussions.microsoft.com> wrote in message news:1EC86E16-9D94-4886-A0B6-1C1537748025(a)microsoft.com... >I have a text box (called ExtendedCost), that has a sum statement in it. I > want to copy the value on the exit control event to another text box > control > (called WithdrawlAmount) on the same form and write the value into > WithdrawlAmount box on the Enter Event for the control box, so people > don't > have to input the same number into the control box. Is there an easy way > to > do this?
From: Daryl S on 29 Apr 2010 13:46 Cbeckwith - In the Enter event for the WithdrawlAmount control, add this: If nz(Me.WithdrawlAmount,0) = 0 Then Me.WithdrawlAmount = Me.ExtendedCost End If The if/then is to prevent a previously-entered value from being over-written. If you want it always to be udpated when the field is entered, then don't use the If/End If statements. -- Daryl S "Cbeckwith" wrote: > I have a text box (called ExtendedCost), that has a sum statement in it. I > want to copy the value on the exit control event to another text box control > (called WithdrawlAmount) on the same form and write the value into > WithdrawlAmount box on the Enter Event for the control box, so people don't > have to input the same number into the control box. Is there an easy way to > do this?
From: fredg on 29 Apr 2010 13:51 On Thu, 29 Apr 2010 10:18:02 -0700, Cbeckwith wrote: > I have a text box (called ExtendedCost), that has a sum statement in it. I > want to copy the value on the exit control event to another text box control > (called WithdrawlAmount) on the same form and write the value into > WithdrawlAmount box on the Enter Event for the control box, so people don't > have to input the same number into the control box. Is there an easy way to > do this? Regarding .. "to copy the value on the exit control event to another text box control" ... That doesn't make programming sense to me. If the [WithdrawalAmount] value is always the same as the [ExtendedCost] value and you wish to display that value in a different text control, then 1) You can simply enter the same [ExtendedCost] control source expression as it's control source? or .... 2) You can refer to the [ExtendedCost] value: =[ExtendedCost] In either case there is no need to save in any table either the [ExtendedCost] value nor the [WithdrawalAmount]. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail
|
Pages: 1 Prev: Run-time error 3021 Next: On Click, Open a form, choose a selection then have it populate fi |