Why do you need the ID on the layout at all? Many developers make it a practice to keep primary key values hidden from the user.
The only way that this makes a difference is when you permit editing the field. If editing is permitted, editing ::ShopID edits the value a related record. Editing ShopID edits the value in the layout's current record. Also, the ::field will be blank if there are no related records. So for that reason, you may want to stick with the field from the layout's table occurrence.
Many thanks Phil, your help is much appreciated.
Turns out that if I use the :: field from the second TO (not the one in the layout) the dropdown list won't work for some reason (what?).
I don't need the ID on the layout, but I was looking to populate it via a value list. Turns out value lists with two fields sorted on the second and showing only that won't allow for autocomplete. Which is very important if you are looking over a list that could have a few hundred records.This is a rather disappointing implementation, but what to do. I am now looking at doing it via a script, or using someone's code to get the desired behaviour.
I don't need the ID on the layout, but I was looking to populate it via a value list.
Sorry but that's a contradiction. If you are using a value list to modify it, it has to be on the layout.
To get auto-complete to work, try the method in this demo file:
FileMaker 12 users: https://dl.dropbox.com/u/78737945/SimpleNameLookupDemo.fmp12
Pre FileMaker 12 Users: https://dl.dropbox.com/u/78737945/SimpleNameLookupDemo.fp7