Hi,
I have used the tutorial Cascading Combo/List Boxes to filter the combo box cboCareManager dependent on the entry to cboLocalityTeam - the common code between the two tables is LocalityCode. cboCareManager and cboLocalityTeam both sit within frmSub which in turn is a subform within frmMain. The AfterUpdate code is as follows:
Essentially this works but when I exit the form and return to the record the text no longer appears in the form - the code (CareManagerCod e) is still in the underlyning table (tblContactDeta ils) but the associated text (CareManagerTex t) no longer appears and the list is empty; I have to reselect an entry in cboLocalityTeam for the data to reappear in cboCareManager.
How do I rectify this so that the data on the form is maintained?
I have used the tutorial Cascading Combo/List Boxes to filter the combo box cboCareManager dependent on the entry to cboLocalityTeam - the common code between the two tables is LocalityCode. cboCareManager and cboLocalityTeam both sit within frmSub which in turn is a subform within frmMain. The AfterUpdate code is as follows:
Code:
Private Sub cboLocalityTeam_AfterUpdate()
With Me![cboCareManager]
If IsNull(Me!cboLocalityTeam) Then
.RowSource = ""
Else
.RowSource = "SELECT [CareManagerCode],[CareManagerText] " & _
"FROM tlkpCareManager " & _
"WHERE [LocalityCode]=" & Me!cboLocalityTeam
End If
Call .Requery
End With
End Sub
How do I rectify this so that the data on the form is maintained?
Comment