Hi All,
I am having a problem with the second combo box on my form.
After selecting the company name from the 1st Combo box the only option available in the second is EmpName.
Here is what I have; the following two tables with the following fields;
TblCompany
ID [Auto Number] [Primery Key]
CpyName
TblEmployees
EmpName
ID
EID [Auto Number] [ Primery Key]
The code I have behind the 1st combo box is as follows;
Could someone please help and advise me where I am going wrong and why I cannot see the employees for the company in the second combo box?
Any help would be appreciated.
Regards
Spike
I am having a problem with the second combo box on my form.
After selecting the company name from the 1st Combo box the only option available in the second is EmpName.
Here is what I have; the following two tables with the following fields;
TblCompany
ID [Auto Number] [Primery Key]
CpyName
TblEmployees
EmpName
ID
EID [Auto Number] [ Primery Key]
The code I have behind the 1st combo box is as follows;
Code:
Private Sub Company_AfterUpdate()
With Me![Employee Name]
If IsNull(Me!Company) Then
.RowSource = ""
Else
.RowSource = "SELECT [EmpName] " & _
"FROM TblEmployees " & _
"WHERE [ID] =" & Me!Company
End If
Call .Requery
End With
End Sub
Could someone please help and advise me where I am going wrong and why I cannot see the employees for the company in the second combo box?
Any help would be appreciated.
Regards
Spike
Last edited: