Question : How define combo box control source for multiple fields?

To simplifie the data entry, I want to combine 2 fields.

I dont have problem to create the list of the combo box and assign the value in the table.
But I cant show the current value from the table.

Here an example: 2 tables, 1 form

tbl_employe =
  employeId    employeName deptId   servId
   1111                  Mark             10          11        
   1212                  Bob               10          12
   1213                  Kim                20          21        
   1223                  Diana            10           11  

Tbl_department:
   department     deptName         serviceId     servName
   10            Production         11          boat
   10            Production          12         car
   20            Inventory            21           Wood
   21            Inventory            22          glue


Form needed:
          Name      Department
           
         Mark        Production-boat
         Bob          Production-Car
         Kim          Inventory-Wood
         Dianna     Production-boat

The information below Department is a combo box lstDept
By this form, the user can change the department and service.

List of the combo box:
SELECT [deptName] & "-" & [servName], deptId, servId
FROM tbl_deparment;                

The change event:
deptId =  lstDept.column(2)
servId = lstDept.column(3)

The problem:
           How can I define the control source of the combo box lstDept in purpose to have
           the department and service name of the current value of the employee.

Answer : How define combo box control source for multiple fields?

Your database design does not follow standard rules of normalisation. You can refer to the following website for an indepth article on database normalisation:

http://www.databasedev.co.uk/database_normalization_basics.html

Due to the lack of normalisation your database cannot provide the flexibility for you to make the changes that you want.


Meanwhile I have modified your db to acheive the outcome that I believe you are after
 
mdb
 
Random Solutions  
 
programming4us programming4us