Passing value from unbound textbox to bound textbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an unbound textbox with a calculated value in the control source
property.
I want to pass this value to a bound textbox at the time that the calculated
value is visible to the user. The bound textbox value should change as the
unbound changes. These boxes are both on the same form

Can you provide any help here?

thanks.
 
Steve said:
I have an unbound textbox with a calculated value in the control source
property.
I want to pass this value to a bound textbox at the time that the calculated
value is visible to the user. The bound textbox value should change as the
unbound changes. These boxes are both on the same form


Not realistically doable. It requires a VBA statement to
copy a value to a bound control, but a text box expression
is calculated as a background task so there are no events
that can be used to retrieve the result of the calculation.

That race condition does bot arise if you would do the
calculation using a VBA procedure instead of a control
expression.

OTOH, generally, you should NOT be saving calculated values
in a table, so this discussion is probably all about trying
to figue out how to go down the wrong road.
 
Maybe I'm misinterpreting, but it seems to me you can do this. If the unbound
value is a textbox the user is typing in, then in that textbox's AfterUpdate
event proc you can put a statement:

BoundField.value = UnBoundField.value

If it's a value that gets changed somewhere in VBA code, then put the above
statement right after the VBA statement that changes the value of the unbound
field. NOt sure if that's what you're askin for though.
 
Back
Top