I can explain the linking but not how the x get's into the field without knowing more about your database design.
If you have the following data in a field used as a key in a relationship
(¶ is the return character and this is why it appears "on the second line" as you describe.)
Then any record in the related table with 1234 OR x in the corresponding key field will match to this record.
There are a variety of ways the "x" could get inserted into the field. Since the user clicks in the field, the field could be set up as a button that performs a script that appends this text to the field when it's clicked. If you are using FMP 10, a script trigger such as OnObjectEnter could be preforming a script that makes this change. It could be this text was perviously entered and you are only discovering it when you click into the field since a second line of text it won't be visible to you until you click into the field.
I haven't seen an 'X' before, though it depends how the operating system displays the character, but especially when people do data entry on a laptop keyboard they often press the Carriage Return key when really they need to go through the awkwardness of pressing 'Fn' and 'Enter', or somesuch combination to make the key emulate a true 'Enter', and this generates control characters, for example. Try doing just that and exporting the field contents into Excel: you will see '1234' (only a true 'Square' character).
Maybe there is a combination of that and Mac / Win that causes the character.
... but mainly the question is: why you gived access to that field, the primary key ?
Thanks, everyone. I will look into the laptop possibility. One of our advisors uses our department laptop when she works from home, and she had the most records.
Also, access is given because multiple people need to enter the student ID. Sometimes it's the advisor, sometimes a staff member, sometimes a student worker. I wish I could restrict access to one person, but since the data is used by so many different parties, I can't think of a way to restrict the field better!
Daniele is suggesting that you not allow anyone to click into this field and edit it by typing in a number. It should either be formatted with a value list with either field format or validation prohibiting a value not in the list or no user should be permitted to enter the field while in browse mode.
In the meantime, you can use Set Field/Control | Behavior... to set up the field so that the Qwerty enter (Return) key exits the field just like the Number pad enter key does.