I'm working in an ADP project (for in case it might influence any feedback/suggestions being made)
I've got a simple Company combo box and depending on the selection will update the Contact combo box with all the contacts belonging to that company.
My code is as follow:
But this piece of code just don't do anything. If I select a company (with contacts allocated to that company), the Contact combo just stays empty.
The Contact combo is bound to a field and should display the contact if one is already allocated, but also a list of possible contacts to that company in the combo box.
I'm sure it is something small, but I can't seem to identify my problem.
Hope you guys will be able to assist.
I've got a simple Company combo box and depending on the selection will update the Contact combo box with all the contacts belonging to that company.
My code is as follow:
Code:
Private Sub cboCompany_AfterUpdate()
Dim strSQL As String
strSQL = "Select distinct Contact_Name from ODS.Contact "
strSQL = strSQL & " where Company_ID = " & cboCompany & " "
cboContact.RowSource = strSQL
Me.cboContact.Requery
End Sub
But this piece of code just don't do anything. If I select a company (with contacts allocated to that company), the Contact combo just stays empty.
The Contact combo is bound to a field and should display the contact if one is already allocated, but also a list of possible contacts to that company in the combo box.
I'm sure it is something small, but I can't seem to identify my problem.
Hope you guys will be able to assist.