Using a List box to populate multiple form fields.

Creating and using forms
Post Reply
Russ_Martinson
Posts: 1
Joined: Mon Apr 04, 2011 7:59 pm

Using a List box to populate multiple form fields.

Post by Russ_Martinson »

Using a List box to populate multiple form fields.

I have created a a database and data entry form to track Service Calls. I am currently adding; “office number”, “office leader”, and “phone” each with a list box entry which is working, however I would like to just select the “office number” and have the “office leader” and “phone” fields for the selected “office number” automatically populate the form Fields from the list box using some type of table look-up. Or, how do I populate 3 fields with a single listbox selection.

Thanks,
Russ Martinson
OpenOffice 3.3 Win XP SP3
Arineckaig
Volunteer
Posts: 828
Joined: Fri Nov 30, 2007 10:58 am
Location: Scotland

Re: Using a List box to populate multiple form fields.

Post by Arineckaig »

I would like to just select the “office number” and have the “office leader” and “phone” fields for the selected “office number” automatically populate the form Fields
Welcome to the forum.

This is likely to be best handled by applying the underlying principles of a Relational Database. The content of your “office leader” and “phone” fields appear to be dependent on the “office number” field. This data could therefore be stored in a separate table whose 'primary key' is linked to a 'foreign key' in your main table that could well be a list box.

I would refer you either to an introduction explanation at:
http://en.wikipedia.org/wiki/Relational_database
or an excellent but longer tutorial that can be downloaded from:
http://openoffice.org/projects/document ... 20tutorial
Last edited by Arineckaig on Tue Apr 05, 2011 7:29 pm, edited 1 time in total.
When this issue has been resolved, it would help other users of the forum if you add the word - [Solved] - to the Subject line of your 1st post (edit button top right).
AOOo 4.1.5 & LO 6 on MS Windows 10 MySQL and HSQLDB
RPG
Volunteer
Posts: 2250
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands

Re: Using a List box to populate multiple form fields.

Post by RPG »

Hello

I don't know if I understand your question correct?. I understand you have one table with one foreign key. You can select the value with a listbox. When make three listboxes and use the datafield but use an other query for displaying a value, I think it can work in the way you want. The new values are shown when the chosen value is stored.

Romke
LibreOffice 7.1.4.2 on openSUSE Leap 15.2
Post Reply