Attempting to link form & table in BASE

Okay, so I created a drop down menu in a form that pulls information from my table “Sales People”. The form is for Customer Entry, and the goal is to link a sales person with each customer. However, when I entered trial data, the Sales Person column in the table format comes up instead of the name. I’m not sure how to resolve this. Thanks!

Edit: Here are images of what I’ve done so far:


Hello,

There are a couple of items you should be aware of. First, your list box may be set up wrong. Before getting to that, it appears your ‘Sales People’ table may be incorrect also if the name is the key. It would be better to save an integer key to the table rather than the actual sales persons name. This type of key is much shorter and saves space. You can still display the names in the list box and the selected name will save the key. This is done in the properties of the list box on the Data tab:

image description

The ‘Data field’ is from your Customer table field. The ‘Type of list contents’ here is SQL so the list can come from another table. The ‘List content’ is the SQL used to retrieve the data from the table (the ellipses button will go to Query design). This example will select Material & ID from a table. The ‘Bound field’ is the field which will be stored in the field (item is relative to 0 so 1 is the second field in the selection).

So with this established, the list box will display all the names contained in the "Material’ field in the ‘Materials’ table. When a material is selected & the record is written the ID associated with that material is placed in the field (because ‘Bound field’ is = 1). If ‘Bound field’ were = 0 then Material would be saved in the field.

For a working sample of this see my answer in this post → Update Record with Listbox Selection. Sample is ListBoxAltSave.odb.

If this answers your question please tick the :heavy_check_mark: (upper left area of answer). It helps others to know there was an accepted answer.

It seems that it still will only port over to the table, even with changing to just the ID number. Do I need to change what type of field it is in the table from “Other”?

Absolutely! That is an almost never used field type. VARCHAR is probable the one to use. See this page → LibreOffice Base Data Types.

OH GOODNESS THANK YOU YOU ARE MY HERO.

Just saw your updated post. You are dealing with a ‘Combo Box’ and not a ‘List Box’. There a number of differences between the two. But the basic saving of data is the selected item in the SQL. Field names should not contain punctuation or begin with numbers. Probably a number of other items. Use Integer for the ID - why not auto increment? Are you assigning a random number? Do you really need TIMESTAMPS or are DATEs sufficient? Just a few noticeable things.

I was unable to find any options for Auto Increment, but I just did, and unfortunately I do need timestamps (keep track of time called). Thanks so much for all your help, looks like I’ve managed to straighten it out some.