You could use the OnObjectValidate trigger to perform a script that uses the data entered (if length = 3 ) to perform a find on the first table to find, and enter the corresponding 4 letter code. But you should be able to set this up with an auto-entered calculaition:
First, in Manage | Database | relationships, make a new table occurrence of table 1 by clicking it and then clicking the duplicate button (2 green plus signs). You can double click the new occurrence box to get a dialog to appear where you can rename the new occurrence box as Table1By3Letter.
We have not duplicated a table. Instead, this is a new reference to the same table already present in your database.
Add it to your relationships like this:
Table 2::textField = Table1By3Letter::3LetterField
Then you can create this auto-enter calculation:
If ( Length ( Self ) = 3 ; Table1By3Letter::4LetterField ; self )
and then clear the "do not replace existing value..." check box.
Works like a charm.