Help with Access Casgading Combo Boxes

Joined
Sep 6, 2008
Messages
8
Reaction score
0
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;

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:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top