Ask Your Question

A dropdown list, inside a control grid table, with SQL consult in BASE

asked 2016-02-26 13:49:43 +0200

alexgomez88 gravatar image

Hi, i need some help to do something i think i have done it before but i dont reember how.

I have a Table with Employee and form to add them or consult something about them... that form also show me information about how they changed their position on time...

For that i have 3 tables: Employee, Departaments, Employee_Departaments...

on my form... on top is the employee information... and down a Control Table to put the job history, the "Employee_Departament subform"

But each departament has a ID and a name... for example "CableTren Bolivariano" is CTB, i want to put a colom that i changed Departament ID for Departament... with a Dropdown list that show department name but load on the dable ID departament. is it posible?

edit retag flag offensive close merge delete


It 'hard to help you without a sample of your database .... gravatar ( 2016-02-26 17:11:24 +0200 )edit

1 Answer

Sort by » oldest newest most voted

answered 2016-02-27 12:18:08 +0200

peterwt gravatar image

With the Form in edit mode right click on the column that is the Department ID and select from the drop down menu "Replace with" and select "List box". Right click again on this column and select "Column". This will bring up the List box properties pop up. In the "Data" tab set "Type of list contents" to "Sql". In "List content" click on the button far right that contains three dots and this will bring up the Sql command screen. Select the table that contains the data you want and in the first column select the Department Name and in the second column select the department ID. Save the Sql. The "List content" will then show something like

SELECT "Name", "DepartmentID" FROM "Table Name"

Make sure that the "Bound field" is set to 1.

When you open this Form to enter data clicking on the ID column will then show the Department name but put the ID in the underlying Table.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-02-26 13:49:43 +0200

Seen: 591 times

Last updated: Feb 27 '16