copy from text box to text box

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!
 
P

Paul

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
 
K

Klatuu

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
 

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