View 'name' while editing 'id' in form table combo box

I am editing a table ‘cultivation_practices’ with a field for ‘reference_id’.
I use a combo box with sql to return ‘reference_name’ and ‘reference_id’ so I can choose from a list of names.
After I click the name ‘Plants for a future Database’ I see the corresponding ‘reference_id’ is displayed ‘0’.

How can I make the table column display the ‘name’ ‘Plants for a future Database’ instead of the ‘reference_id’ ‘0’?

A combo box is just the same as a text box plus auto-complete. It writes the selected text into the linked field or any other text you type.
Right-click>Replace with>Listbox
LInked field: XID (name of a foreign key field)
Source type: SQL
Source: SELECT "name","ID" FROM "other table" ORDER BY "name" ASC
Input required: Yes (if “No”, there will be an empty entry on top)
Bound field: 1 (which unfortunately refers to the second field “ID”)
Now you have a listbox of item names from “other table”, and when you pick a name, its ID is written into this form’s column “XID”.

Instead of source type SQL you may also use Query and use a query name as source.

2 Likes