Using a List box to populate multiple form fields.

Creating and using forms

Using a List box to populate multiple form fields.

Postby Russ_Martinson » Tue Apr 05, 2011 5:56 pm

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
Russ_Martinson
 
Posts: 1
Joined: Mon Apr 04, 2011 7:59 pm

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

Postby Arineckaig » Tue Apr 05, 2011 7:18 pm

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/documentation/downloads/directory/Base/Mid%20level%20Base%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).
OOo 3.4.1 on MS Windows XP MySQL and HSQLDB
Arineckaig
Volunteer
 
Posts: 600
Joined: Fri Nov 30, 2007 10:58 am
Location: Scotland

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

Postby RPG » Tue Apr 05, 2011 7:29 pm

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
openSuse version of LibreOffice 4.1.5.3 stable on openSUSE 12.2
RPG
Volunteer
 
Posts: 1548
Joined: Tue Apr 14, 2009 7:15 pm
Location: Netherlands


Return to Forms

Who is online

Users browsing this forum: No registered users and 2 guests