Ask Your Question

Attempting to link form & table in BASE

asked 2018-04-26 17:23:43 +0100

ShaunaFahad gravatar image

updated 2018-04-26 19:02:45 +0100

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 <object> instead of the name. I'm not sure how to resolve this. Thanks!

Edit: Here are images of what I've done so far: image description image description

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2018-04-26 18:17:20 +0100

Ratslinger gravatar image


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 ✔ (upper left area of answer). It helps others to know there was an accepted answer.

edit flag offensive delete link more


It seems that it still will only port over <object> 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"?

ShaunaFahad gravatar imageShaunaFahad ( 2018-04-26 18:34:55 +0100 )edit

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

Ratslinger gravatar imageRatslinger ( 2018-04-26 19:07:18 +0100 )edit


ShaunaFahad gravatar imageShaunaFahad ( 2018-04-26 19:11:15 +0100 )edit

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.

Ratslinger gravatar imageRatslinger ( 2018-04-26 19:12:59 +0100 )edit

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.

ShaunaFahad gravatar imageShaunaFahad ( 2018-04-26 19:53:19 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-04-26 17:23:43 +0100

Seen: 84 times

Last updated: Apr 26 '18