Which event procedure

Which event procedure

am 17.04.2008 14:44:59 von Ondernemer

I want a calculated control to transfer its value to a bound field in a
table. I.e. I have a calculated control named txtFinalBid that adds several
fields in a table. I want that number to be transfered to a bound control in
the table named FinalBid. I've tried using all of the event handlers and
none will make the transfer.

Re: Which event procedure

am 17.04.2008 15:32:35 von Jebusville

"Kevin" wrote in message
news:fDHNj.493911$r03.48037@fe10.news.easynews.com...
>I want a calculated control to transfer its value to a bound field in a
>table. I.e. I have a calculated control named txtFinalBid that adds several
>fields in a table. I want that number to be transfered to a bound control
>in the table named FinalBid. I've tried using all of the event handlers and
>none will make the transfer.
>

What event do you want to trigger the writing of the data? If the form is
dirty then use the Before Update event. I'm presuming that you have a good
reason to want to store the calculation, but have you considered doing it at
run-time in a query?

Keith.
www.keithwilby.com

Re: Which event procedure

am 17.04.2008 15:46:25 von Ondernemer

The field FinalBid is in fact a somewhat arbitrary number. The form makes a
number of calculations based on what is entered into various fields and
creates a number that is in txtFinalBid. The user will then evaluate that
number to come up with the FinalBid number. However, I want that number to
change with the calculations until the end of the estimate.

"Keith Wilby" wrote in message
news:48074d72$1_1@glkas0286.greenlnk.net...
> "Kevin" wrote in message
> news:fDHNj.493911$r03.48037@fe10.news.easynews.com...
>>I want a calculated control to transfer its value to a bound field in a
>>table. I.e. I have a calculated control named txtFinalBid that adds
>>several fields in a table. I want that number to be transfered to a bound
>>control in the table named FinalBid. I've tried using all of the event
>>handlers and none will make the transfer.
>>
>
> What event do you want to trigger the writing of the data? If the form is
> dirty then use the Before Update event. I'm presuming that you have a good
> reason to want to store the calculation, but have you considered doing it
> at run-time in a query?
>
> Keith.
> www.keithwilby.com

Re: Which event procedure

am 17.04.2008 16:57:39 von fredg

On Thu, 17 Apr 2008 13:46:25 GMT, Kevin wrote:

> The field FinalBid is in fact a somewhat arbitrary number. The form makes a
> number of calculations based on what is entered into various fields and
> creates a number that is in txtFinalBid. The user will then evaluate that
> number to come up with the FinalBid number. However, I want that number to
> change with the calculations until the end of the estimate.
>
> "Keith Wilby" wrote in message
> news:48074d72$1_1@glkas0286.greenlnk.net...
>> "Kevin" wrote in message
>> news:fDHNj.493911$r03.48037@fe10.news.easynews.com...
>>>I want a calculated control to transfer its value to a bound field in a
>>>table. I.e. I have a calculated control named txtFinalBid that adds
>>>several fields in a table. I want that number to be transfered to a bound
>>>control in the table named FinalBid. I've tried using all of the event
>>>handlers and none will make the transfer.
>>>
>>
>> What event do you want to trigger the writing of the data? If the form is
>> dirty then use the Before Update event. I'm presuming that you have a good
>> reason to want to store the calculation, but have you considered doing it
>> at run-time in a query?
>>
>> Keith.
>> www.keithwilby.com

Then why save that calculated data if the user can change it?
Show the calculation on the form in an unbound control.
Have another control, bound to the field in the table, into which the
user can enter, either the calculated total or his own value as the
FinalBid.
Do not store the calculation. It's valueless if it can be arbitrarily
changed. Anytime in the future that you wish to know what the
calculated value was, simply re-calculate it, using the saved
component data.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Re: Which event procedure

am 17.04.2008 17:04:37 von Ondernemer

Perhaps I'm not saying this correctly. My apologies if it is unclear. the
control txtFinalBid is not bound. It is an unbound control that calculates
an "estimated final bid" that the user sees on screen. As the user enters
data in other fields, txtFinalBid is continuously updated. The bound field
is FinalBid (without txt in front). This is technically an empty field that
the user would be required to manually enter a number for a final bid price.
However, I want to populate that field with the calculated number from
txtFinalBid each time that number or answer is changed.

"fredg" wrote in message
news:1k24rm30l8bhu.1ugve46eiiodx$.dlg@40tude.net...
> On Thu, 17 Apr 2008 13:46:25 GMT, Kevin wrote:
>
>> The field FinalBid is in fact a somewhat arbitrary number. The form makes
>> a
>> number of calculations based on what is entered into various fields and
>> creates a number that is in txtFinalBid. The user will then evaluate that
>> number to come up with the FinalBid number. However, I want that number
>> to
>> change with the calculations until the end of the estimate.
>>
>> "Keith Wilby" wrote in message
>> news:48074d72$1_1@glkas0286.greenlnk.net...
>>> "Kevin" wrote in message
>>> news:fDHNj.493911$r03.48037@fe10.news.easynews.com...
>>>>I want a calculated control to transfer its value to a bound field in a
>>>>table. I.e. I have a calculated control named txtFinalBid that adds
>>>>several fields in a table. I want that number to be transfered to a
>>>>bound
>>>>control in the table named FinalBid. I've tried using all of the event
>>>>handlers and none will make the transfer.
>>>>
>>>
>>> What event do you want to trigger the writing of the data? If the form
>>> is
>>> dirty then use the Before Update event. I'm presuming that you have a
>>> good
>>> reason to want to store the calculation, but have you considered doing
>>> it
>>> at run-time in a query?
>>>
>>> Keith.
>>> www.keithwilby.com
>
> Then why save that calculated data if the user can change it?
> Show the calculation on the form in an unbound control.
> Have another control, bound to the field in the table, into which the
> user can enter, either the calculated total or his own value as the
> FinalBid.
> Do not store the calculation. It's valueless if it can be arbitrarily
> changed. Anytime in the future that you wish to know what the
> calculated value was, simply re-calculate it, using the saved
> component data.
> --
> Fred
> Please respond only to this newsgroup.
> I do not reply to personal e-mail

Re: Which event procedure

am 18.04.2008 09:36:36 von Jebusville

"Kevin" wrote in message
news:9GJNj.22114$iA4.5332@fe08.news.easynews.com...
> Perhaps I'm not saying this correctly. My apologies if it is unclear. the
> control txtFinalBid is not bound. It is an unbound control that calculates
> an "estimated final bid" that the user sees on screen. As the user enters
> data in other fields, txtFinalBid is continuously updated. The bound field
> is FinalBid (without txt in front). This is technically an empty field
> that the user would be required to manually enter a number for a final bid
> price.

IMHO this nomeclature will cause confusion so I will stick my neck out and
change it for the purpose of my response because I always prefix text box
names with "txt" for ease of identification in code.

> However, I want to populate that field with the calculated number from
> txtFinalBid each time that number or answer is changed.

In the form's Before Update event:

Me.txtStoredFinalBid = Me.txtCalcFinalBid

Obviously this will only commit the data to the field when the record is
saved. Is that what you wanted? Again, I assume you have a good reason to
store a value that one would normally calculate at run-time in a query.

Regards,
Keith.
www.keithwilby.com