Hi
I hope this is in the right section, only just stumbled across this site, and am not to sure of my way around it yet. So please let me know.
Ok, so basically I am creating a very basic database to store employee training details.
The above is the basic layout of tables.
The field tblEmployee.DepartpmentName is a combo box lookup field where it is linked to a Query that lists tblTraining.DepartmentName, so only departments that are set up are listed, they are also grouped so no multiple data.
Now I want to create a similar but more complex lookup for the tblEmployeeTraining.TrainingID field. So when I input an Employee ID into tblEmployeeTraining.EmployeeID and then go to select tblEmployeeTraining.TrainingID from a drop down combo box, only those Training ID’s whose department name equals that of tblEmployeeTraining.EmployeeID departments name are listed.
Now I have made a stab at this, this is the SQL code behind the query:
SELECT [tblTraining].[ID], [tblTraining].[TrainingName]
FROM tblTraining INNER JOIN tblEmployee ON [tblTraining].[DepartmentName]=[tblEmployee].[DepartmentName]
WHERE [tblEmployeeTraining].[EmployeeID]=[tblEmployee].[ID];
This almost works, I have my combo box for tblEmployeeTraining.TrainingID but when I click on it I get the following input box. It doesn’t seem to see my value in the Employee ID field.
I can enter an employee number here and the correct Training ID’s based on the employees department name are listed. How can I get this to read the EmployeeID automatically so I don’t have to input it again?
Many Thanks
Gary
I hope this is in the right section, only just stumbled across this site, and am not to sure of my way around it yet. So please let me know.
Ok, so basically I am creating a very basic database to store employee training details.
The above is the basic layout of tables.
The field tblEmployee.DepartpmentName is a combo box lookup field where it is linked to a Query that lists tblTraining.DepartmentName, so only departments that are set up are listed, they are also grouped so no multiple data.
Now I want to create a similar but more complex lookup for the tblEmployeeTraining.TrainingID field. So when I input an Employee ID into tblEmployeeTraining.EmployeeID and then go to select tblEmployeeTraining.TrainingID from a drop down combo box, only those Training ID’s whose department name equals that of tblEmployeeTraining.EmployeeID departments name are listed.
Now I have made a stab at this, this is the SQL code behind the query:
SELECT [tblTraining].[ID], [tblTraining].[TrainingName]
FROM tblTraining INNER JOIN tblEmployee ON [tblTraining].[DepartmentName]=[tblEmployee].[DepartmentName]
WHERE [tblEmployeeTraining].[EmployeeID]=[tblEmployee].[ID];
This almost works, I have my combo box for tblEmployeeTraining.TrainingID but when I click on it I get the following input box. It doesn’t seem to see my value in the Employee ID field.
I can enter an employee number here and the correct Training ID’s based on the employees department name are listed. How can I get this to read the EmployeeID automatically so I don’t have to input it again?
Many Thanks
Gary