Good day , guys .
Small problem ... SQL related
I have 2 tables and one combo refreshing other combo
Table_Companies :
[Comp_ID] [ Comp_Name ]
1 Comp_a
2 Comp_b
Table_Projects :
[Project_ID] [Comp_ID] [Project_Name]
1 1 Proj_a
2 1 Proj_b
3 2 Proj_c
Combo_Sel_Project ( default row source :
Combo_Sel_Company( default row source :
The On_Change event for Combo_Sel_Project is indeeed my problem :
The resultat should update Combo_Sel_Company with the companies ID and NAME from Table_Companie , which are conected to the selected PROJECT in Combo_Sel_Project .
The problem is that after runing the code , nothing is listed in the Combo_Sel_Company . .... Stucked
Small problem ... SQL related
I have 2 tables and one combo refreshing other combo
Table_Companies :
[Comp_ID] [ Comp_Name ]
1 Comp_a
2 Comp_b
Table_Projects :
[Project_ID] [Comp_ID] [Project_Name]
1 1 Proj_a
2 1 Proj_b
3 2 Proj_c
Combo_Sel_Project ( default row source :
Code:
" SELECT Project_ID , Project_Name from Table_Projects " )
Code:
"SELECT Comp_ID ,
Comp_Name from Table_Companies " )
Code:
if not isnull(me.Combo_Sel_Company.column(0)) then
me.Combo_Sel_Company.rowsource = " SELECT Comp_ID , Comp_Name "_
& " FROM Table_Companies INNER JOIN Table_Projects " _
& " ON Table_Companies.Comp_ID = Table_Projects.Comp_ID
& " WHERE (((Table_Projects.Project_ID) = " & me.Combo_Sel_Project.Column(0) & " )) "
me.Combo_Sel_Company.requery
The problem is that after runing the code , nothing is listed in the Combo_Sel_Company . .... Stucked