Passing value from unbound textbox to bound textbox

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.
 
M

Marshall Barton

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top