copy from text box to text box

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

I need to automatically/immediately copy a value on my form entered into a
text box to another text box on the same form. The value should copy over
every time the original value changes. The text boxes are both short date
values.

Example:
Text_Box_A changes FROM null TO 1/10/08, then Text_Box_B changes FROM null
TO 1/10/08
If Text_Box_A changes FROM 1/10/08 TO 1/17/08, then Text_Box_B changes FROM
1/10/08 TO 1/17/08

and so on....

Thoughts? I've tried using an AfterUpdate macro using 'SetValue' of
Text_Box_B equal to Text_Box_A but that is not working - no matter what I
type in Text_Box_A, nothing is every being populated in Text_Box_B.

Thanks!
 
FYI...I can get it to work if I put in the following code on the 'Close'
button:

me.text_box_b = me.text_box_a

But, I would really like it to work as an AfterUpdate or Change event in the
text_box_a field, which the same code tied to them doesn't work.

Thanks
 
First, avoid using the Change event. It will fire on each keystroke, which
is probably not what you want. You could use the After Update event IF you
only want text box b to change when text box b is changed manually by the
user. You code will work in the After Update event.

me.text_box_b = me.text_box_a
 
Back
Top