Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

To fields equal each other

Status
Not open for further replies.

dmaranan

Programmer
Aug 14, 2001
46
US
I hope that this is an easy question:

I have two fields that need to equal each other, i.e. once the data changes in one, the other field needs to also change. (You may ask why not combine the fields; I have no answer.)

Thanks for your help.
 
2 ways to do it:

1. If the user always edits only 1 of the fields, then set the control source property of the 2nd field equal to the first field (i.e. =Text1)

2. In the afterupdate event of each of the fields, set the other equal to the current field.
 
I tried option 1, and it doesn't work. When I look at the table the field is blank for one of the fields.

How do I do opption 2?
 
I'm doing this through a form. I'm just not sure what to put in the field for event/ afterupdate.
 
Assume that one field is named Text1 and the second field is named Text2. In the afterUpdate event of Text1, do this:

Text2 = Text1

In the afterUpdate event of Text2, do this:

Text1 = Text2

Now, if the user can only enter data into Text1, then no need for an afterUpdate event for Text2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top